LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert a line into the top of text file

Hi,

I am trying to log alarms of a system.  How can I write the latest alarm info onto the top of a text file every time an alarm is triggered?



hellolv
0 Kudos
Message 1 of 3
(3,192 Views)
  1. Read file into a string.
  2. Prepend the string you want to add to the contents of the file.
  3. Write the new string out to the file.

You can't "insert" text into a text file and have it automatically shift the contents "down".

Another possibility that I read is to play games with reversing the string.

Message Edited by smercurio_fc on 04-11-2007 11:00 AM

0 Kudos
Message 2 of 3
(3,181 Views)
Hello:

Just to complete the previous posting, here is a VI that does what you need, so you can take it as a basis to finish your program.

Regards.

Robst.



Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 3 of 3
(3,160 Views)