LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading data from a text file

Solved!
Go to solution
I have a text file in a data archive that contains various information (numeric and string) that I need to load into different controls in a VI would I have to open the file and look for certain characters to begin and end loading?  The information was previously stored by the VI from the control so can I simply load a previous set of data by using it's data path and control file name?
0 Kudos
Message 1 of 4
(3,668 Views)

You indicated that the information was previously stored by the VI "from the control". How was the information stored to file? What does this file look like? Can you post an example?

 

I don't quite understand the part "load a previous set of data by using it's data path and control file name".

0 Kudos
Message 2 of 4
(3,656 Views)

Sorry for being unclear earlier the file is a .dat text based file and it is written to a data archive in a VI by creating a path to the data archive. I want to be able to load data into controls in the same VI from previous files.

 I attached a sample file and from this I need the voltages gas puffing TSMs and waveforms (OH, TF, etc)

 

0 Kudos
Message 3 of 4
(3,633 Views)
Solution
Accepted by sswager

I assume that the numbers following the "OH data is listed below:" is supposed to go into a 2D array?

 

There are several ways to do this. One simple way is to simply read the file and chop off each section of interest, and converting the string to a 2D array, like this:

 

 

 

Another is to read the file in using the Read From Spreadsheet File, and then indexing out the first column, and use that to search for the indices where the regions of interest lie. You can then use Array Subset to get the 2D array of data.

Message Edited by smercurio_fc on 07-22-2009 02:56 PM
Message 4 of 4
(3,623 Views)