LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take line by line from file?

1)How to take out line by line from a file?
2)is it ,i should store contain of the file to a string control first ,then manipulate it from that string control?If like this,how to make the string control invisible?
0 Kudos
Message 1 of 6
(3,323 Views)
5167;

In the File I/O menu in the function palette there is a VI called "Read Lines from File". You can use that VI to read to go line by line in your file.

To make a control/indicator invisible, in the diagram panel right-click the icon that represents the control and select "Hide Control" (or "Hide Indicator", as appropriate)

Regards;
Enrique Vargas
www.vartortech.com
0 Kudos
Message 2 of 6
(3,323 Views)
LabView ships with an example which reads text from a file and parses and interprets that text. As seen in that example, you don't need to read the string directly to an indicator on your front panel. The string can exist only on your diagram and can be manipulated there. If you don't want the user to see the string, you probably don't need a front panel indicator. Don't create an indicator just to make it invisible.
To find the LabView examples, from any LabView window, goto Help >> Find examples >> Search, then enter FILE in the box labeled Type a keyword to find. Select File I/O and look at Read From Text File.vi. You need to first run Write to Text File.vi to create the file you'll read.
Message 3 of 6
(3,323 Views)
i want to read one line by a line until eof but the " Read Lines From File" is only read a line.
0 Kudos
Message 4 of 6
(3,323 Views)
The LabView example Read from Text File.vi reads one line at a time in a loop until an error (including EOF) occurs. Read Lines From File.vi either dumps the entire file to a string, which you then need to parse, or it forces you to keep track of file pointers since it always opens and closes the file.
I think the example Read from Text File.vi is a much simpler and cleaner approach: open the file, read and manipulate one line at a time in a loop until you reach EOF (or get another read error), close the file.
0 Kudos
Message 5 of 6
(3,324 Views)
I did this .vi (LV 7.1) that might be useful
it reads a single line froma a file.

check it out!

Daniele
Download All
0 Kudos
Message 6 of 6
(3,068 Views)