LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I append to the beginning of a text file without overwriting text already there?

I think the message body says it all.  I can certainly add new text to the file, but it is always getting overwritten.  Any suggestions?
0 Kudos
Message 1 of 3
(3,493 Views)

The easiest way to do this is to read the file into a string using the read from txt file VI, insert the text you want using the string functions, and then write it back to a file using the write to txt file VI.

Brian

Message 2 of 3
(3,486 Views)
How do you plan on reading the data?  If you plan on reading it all at once with another vi, you could reverse the string and write it to the end of the data file.  Then when you read the file, reverse again.  Presto: data in reverse chronological order.

If you want to read it with notepad or excel or something, your best bet is to use Brain's suggestion.
Message 3 of 3
(3,476 Views)