LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to parse data from a text file with no convenient delimiters?

I need to read data from a text file.  This file contains one line of data with the repeating pattern "time 00 ADVar2: ___ Height: ____ time 01 ADVar2: ___ Height: ___ ..."  I need LabView to parse out the "time" and "height" values, build an array with the values, and graph the correlation on an X&Y plot.  Does Labview have an automated way to read to the input data file and parse out the correct values, even without convenient delimiters?  Thank you.
0 Kudos
Message 1 of 3
(2,977 Views)

Use the String matching functions in a while loop with a shift register to parse the string.  Then convert the numeric string parts to numbers and put them in the arrays.  There are several string functions.  Look at them to see which will work best for your case.

 

Lynn 

0 Kudos
Message 2 of 3
(2,971 Views)

You actually do have a convenient delimiter: "time". Thus, you can make an array using that as the delimiter. Only caveat is that the first array element will be empty. Then you can conveniently use the Scan From String function in a for-loop. Something like this:

 

Message Edited by smercurio_fc on 11-21-2008 03:13 PM
0 Kudos
Message 3 of 3
(2,966 Views)