LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to parse a file-read from text file.vi

I'm attempting to read a txt file that has tab separated data. In the fourth (or any) column is the only data I need. The data is a string of numbers (23.454).
I've used the Read from Text File.vi and the Read From Spreadsheet.vi and I just don't seem to have enough LV background to extract the pertinent  data into a graph. any suggestions?
0 Kudos
Message 1 of 9
(4,133 Views)
ok,

That should be very simple.

But if want my help, please attach the text file and I will do an example for you.

Please say what's your labview version, if you need my example.
Software developer
www.mcm-electronics.com





PORTUGAL
Message 2 of 9
(4,122 Views)

Here is a basic example.  It reads a text file and extracts the 4th column (col 3) and puts the values to a graph.

 

Message 3 of 9
(4,119 Views)
Use read from spreadsheet file and you'll end up with a 2D array of numbers. You need two indices to get your value, e.g. row=0, column=3. You can also get the entire fourth column by leaving the row index unwired.
 
(indices start with zero, so to get the fourth element, use an index of 3)
 
Do you have an example text file?
0 Kudos
Message 4 of 9
(4,118 Views)
 
0 Kudos
Message 5 of 9
(4,107 Views)

Using LV 8.0, have not installed the upgrade yet to 8.2.

Sample file attached..........

 

0 Kudos
Message 6 of 9
(4,103 Views)
hello,

The vi posted can do what you want. I've just saved in 8.0.
Software developer
www.mcm-electronics.com





PORTUGAL
Message 7 of 9
(4,098 Views)
(It is silly to use "delete from array" if all you want is a column. The correct function is "index array")
 
Joe's idea above basically works fine. Here's a quick adapdation (the node before the graph is "index array" from the array palette.).
 

Message Edited by altenbach on 06-11-2007 11:57 AM

Message 8 of 9
(4,098 Views)

Opps.. my bad..  I'm getting dyslexic with LV!!

Thanks Altenbach!

0 Kudos
Message 9 of 9
(4,084 Views)