06-24-2010 09:57 PM
I've attached my diagram. The problem(s) I am having are as follows
I need to read the data from a .txt (alternately .lvm) file 250 entries at a time. The problem with the construction I have now is that the dynamic to array buffer kind of destroys the point of segmenting the data because it reads it in all at once. In addition, I need a way of reading and writing this data so that I am not using the express VI's. Pretend my data file is say C:\data.txt and it is a single column of values approx. 5m entries long.
Further, I have set up the while loop to stop after everything has been processed, I need to set it up such that the while loop stops when all the data have been read in.
Thanks for the help.
Solved! Go to Solution.
06-24-2010 10:17 PM
Sorry, to clarify: I'm also looking for a way to read in a long column of data from a .txt file without using the "Read from Measurement File" express VI
06-24-2010 10:36 PM
Search the examples for file input and output. There is a read lines from file function that should do what you need. Search the forums for some examples also.
06-24-2010 10:40 PM
That vi gives me a string, what I am looking for is a way to import this data directly as a 1D array.
Thanks.
06-24-2010 10:59 PM
Since you have a text file (.lvm file), you can't read the file in direct binary form because the data simply isn't stored that way. The numbers are stored as ASCII characters, which means you have to read them as ASCII characters and then convert them to numbers.
06-25-2010 02:31 AM
06-25-2010 06:48 AM
Attach your data file and we'll take a look. There are numerous functions to convert strings into numbers of various formats.
06-25-2010 08:48 AM
Does your file have more than one column? How are rows and columns separated in your file? You need to specify more than just that the data is in a column in a text file.
Lynn
06-25-2010 10:41 AM
Sorry, I meant to specify that there is only one column. I have attached a similar data file. My file has the same structure, but has about 2m entries.
06-25-2010 11:40 AM
Use the Number of Rows and Offset inputs and the Mark after Read output to get a segment of your array. Put it into a loop until finished or until maximum amount of data you can handle at one time is in memory.
Lynn