02-08-2006 09:51 AM
02-08-2006 10:08 AM
Hi Research,
An easy method would be to either populate a table or an array and pick the value needed without re-opening the file. You can use the "Read Characters From File.vi", which is located under "File I/O" in the Functions Palette. You can parse the content of the text file by using the vi's located in the Function Palette under "String" and "Array" if you wish to go the array route. The advantage of using an array (or table) is that it can be wired elsewhere in your vi or sent to other vi's or sub-vi's. Especially if you only read from the text file.
Regards,
Ray
02-08-2006 10:50 AM
Ray,
I am using LabVIEW 8.0 and I could not find "Read characters from file.vi" under File I/O menu. Has this been replaced with a different name from previous versions. And how does one parse a string or read values from a table once it has been populated.
02-09-2006
12:51 PM
- last edited on
08-04-2025
01:16 PM
by
Content Cleaner
Hi Research,
Depending on the format of the data file, there are a few options for reading it. If it is tab delimited, you may want to use the Read from SpreadSheet File VI which will read the file into an Array. You can then use the Index Array VI to pull out individual entries. If the files is ASCII but not tab delimited, you could use the regular Open File and Read File VIs. You can either read the file out piece by piece, or read the entire file into a string and then use the Match Pattern VI to parse out the different elements (there are actually many ways to do this - check out the Strings subpalette).
Since you're new to LabVIEW, you may want to check out these resources:
Getting Started with LabVIEW
I hope this helps! Let us know if you have more questions,
Megan B.
National Instruments