LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding adding a column to an tab delimited text file

Hello to all,
 
How can i add a colum to a multi row tab delimited text file?
 
What I am doing is receiving data and storing it to a file. I am storing the data received by columns. Is there a way that i can append the file and add the next data info receive to the next column in the file?
 
 
FredFred
0 Kudos
Message 1 of 4
(2,635 Views)

You can use Insert Into Array and wire the column index input instead of the row index as shown in the following pic:

Just be sure that the number of elements in Array2 is the same as the number of rows in Array1.

Message Edited by tbob on 03-07-2006 11:32 AM

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,634 Views)

I understand what you stated and thanks for the response but,

What i mean is that:

How can you insert a column into an already written text file?

 

Thanks-N-Advance

FredFred

0 Kudos
Message 3 of 4
(2,623 Views)
FredFred,

That was discussed, possibly more than a year ago if I recall correctly, on this forum. Because files are written sequentially, it is very difficult to "insert" data into a file. If you know in advance how big the file will be and the data format has a fixed number of characters per data field, you could write a file with default data (such as NaN) and then overwrite it with the real data later by calculating the file offsets. Goof up and you have destroyed a lot of data! If the file changes size then the OS has to find new space for it on disk. The consensus was that you should (1) read the file, append the data and then write to a new file or (2) write the data sequentially then read it in and transpose it and write it to a new file after finishing the acquisition.

Another option might be to put the data into a database and use database tools to re-organize the data.

Lynn
Message 4 of 4
(2,615 Views)