LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Long input string of +300.000 values, need syntax to match and return E values

Hi all, first poster here,

I'm stuck with a stupid problem.  I'm getting a long string of +300.000 values as an input from a machine with all kinds of symbols, pos, negative and even xx.xxxE-0(x) power data. The're all presented with a space in between and in one long row.  I need to scan the whole string for certain values to reduce the amount of data (losing the letters and symbols) and put them in an array of 3 rows and x columns (depending on the usability of the data).
So far I've succeeded in obtaining about all the data and representing them in 3 rows with x colums but somewhere the scan drops of all the E power data. So for instance 3.334261E-03 gets me a 3.334261 value.
Next question would be if there is a quick way of doing this scan since it takes a long time to read the whole file in. The conversion from string to the numbers works just fine.

This is the scanning syntax I'm using in the match pattern, [+]?[-]?[0-9]?[.]+[0-9]?[E]?[0-9]*

Thanks for reading/listening to this first poster and your answers.

Labster11
0 Kudos
Message 1 of 13
(3,238 Views)
300 values is not that many.  It should read from file pretty quickly.
 
Please post whatever code you have so far and perhaps some sample data.
 
I would think read from spreadsheet file with a space delimiter should work.
0 Kudos
Message 2 of 13
(3,228 Views)
I think the poster means 300 thousand...

The problem is the space before the 'E'.
See the following code:

I don't know about speed but this should do.

Ton





Message Edited by TonP on 06-30-2008 04:42 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 13
(3,223 Views)
"Spreadsheet string to array" with "space" as delimiter, 1D DBL array as type, and %f as format should handle everything just fine, see e.g.:
 
 
EDIT: Ton, where did you see a space before the E?


Message Edited by altenbach on 06-30-2008 07:46 AM
0 Kudos
Message 4 of 13
(3,221 Views)


@altenbach wrote:

EDIT: Ton, where did you see a space before the E?

Well I thougth I saw a space, must be some rendering issue.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 13
(3,198 Views)

I think Ton was referring to this:



Message Edited by JoeLabView on 06-30-2008 12:50 PM
0 Kudos
Message 6 of 13
(3,188 Views)
Yes, but that is Ton's screenshot, not the original posters.
0 Kudos
Message 7 of 13
(3,184 Views)
I'm not arguing...  😉  just supporting Ton.. 😄
0 Kudos
Message 8 of 13
(3,180 Views)


JoeLabView wrote:
I'm not arguing...  😉  just supporting Ton.. 😄


Me neither, I was just supporting Altenbach.Smiley Very Happy

It's about time for the original poster to respond to see if any of the messages helped, and if not, to post some code and some data so we don't have to guess whether there are "extra" spaces.Smiley Happy

0 Kudos
Message 9 of 13
(3,176 Views)
Hi all,

Thank you very much for enlighting me.  Sometimes it helps if you get another view from more experienced members.  This approach didn't jump into my mind so I didn't consider this possibility. 'Search and replace' in combination with 'Spreadsheet to string array' solved the first problem, now I can scan from all the values for the valuable data as is needed.
But for the second part of my question, it was indeed +300.000 (thousand) data points.

Part two: I need to scan the whole string (now array) and get values that can differ acording to the machines settings, so the limits can vary.  Comparing with high-low limits is fairly easily done, but it takes a hell of a long time to read me the array values I need. The largest file is about 1.200.000 data points. Yes, a 1,2 million here. Smiley Happy
How do I break this long list up or how can I get the maximum speed while scanning?

Anybody?

Thanks again for answering!

Labster11


0 Kudos
Message 10 of 13
(3,141 Views)