LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read out an text file??

How can i read out a text file... For example
 
text.txt....
 
I need to no what's the string in Line1, line2 etc
 
Can I read out a text file line for line??
 
 
0 Kudos
Message 1 of 5
(8,957 Views)

Use the Read from Text file VI from the File I/O pallet.

 

Plonk it on the diagram then right click on the VI and select "Read Lines" from the drop down menu

 

Craig

LabVIEW 2012
0 Kudos
Message 2 of 5
(8,952 Views)
I've tried to do this but,
 
I use te read out text file item..... Enable read lines.... Put on the count input 1 or 2.......  and put that in an string indicator.........
 
but it won't work......... i only see the first line of my text file in the string indicator........
 
It may be very easy but i can't solve this problem.....
 
can anyone help me?
0 Kudos
Message 3 of 5
(8,930 Views)
What version of LV are you using. If you are using 8.2 use the read text from file right click on it and select read from lines. If you want to read the entire file wire a -1 to the count terminal. The output of this function is a string array where each element of the array is one line from the file. NOTE: If you do not wire anything to count the function only returns the first line in the file by default.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 4 of 5
(8,925 Views)
Hello,
 
I recommend reading the entire file and then using the array functions to selectively take information from the file.  Not only is it easier, in my mind, but it allows you to do more with your information.
 
Regards,
0 Kudos
Message 5 of 5
(8,917 Views)