LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to prepend text to a text file?

Solved!
Go to solution

Hello folks,

 

Is it possible to prepend text to the beginning of a text file?  That is, insert text at the beginning of a text file and simply "push" the rest of the contents of the file to a higher offset rather than overwriting the existing data?

 

Thanks for the help!

Chris 

0 Kudos
Message 1 of 2
(2,928 Views)
Solution
Accepted by topic author chassan

Hi Chris,

 

no, it isn't...

 

You can do it the trivial way: read in the old text, prepend the header, write out the full new text...

 

Or the safe way:

- write header to new file

- read old file (in blocks) and write in append mode to new file

- delete old file

- rename new file to have the name of the original file

Message Edited by GerdW on 07-06-2009 09:43 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(2,926 Views)