LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting line of text

I want to insert a line of text or multiple lines of text into an existing text file.

I don't want to convert the existing text file into an array etc.

would somebody be able to show me an example of that?

 

I will attach an example of the text file

0 Kudos
Message 1 of 3
(384 Views)

A file is basically just a long string, so unless you append your new lines to the end, many bytes need to rewritten.

The concept of "lines" is just the presence of a special delimiter, e.g. a linefeed.

 

For anything else, easiest would be to read the entire file as a string, modify it, and write it back to the file. This does not need to have anything to do with arrays.

 

Please show us your code and explain whet you want to insert and where.

0 Kudos
Message 2 of 3
(343 Views)

Well once again you solved my problem just by simply stating the basic idea in which a text file is simply a continuous string of characters.

Thank you for the excellent help!

Chris

0 Kudos
Message 3 of 3
(280 Views)