From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to a specific line in text file

hi let say text file with five lines
i need to write it in a specific line example line 3.
how to do tht,
thk u
0 Kudos
Message 1 of 6
(3,812 Views)
Hi jeyanthi,
here is an example how you can solve it with your data.
Hope it helps.
Mike

Message Edited by MikeS81 on 05-23-2008 08:05 AM
0 Kudos
Message 2 of 6
(3,806 Views)

In Mike's example, you cna change the constant 2 to a control which allows ytou to select which line to write to.

2 meaning the third position becasue indexing starts at 0.  😉

0 Kudos
Message 3 of 6
(3,778 Views)
I read the question as wanting to insert text into an already existing text file. If that's the case, you need to read in the text file, insert your text, and then write out the new text to the file.

Could be wrong though.
0 Kudos
Message 4 of 6
(3,748 Views)

@Mike can you tell me what is the name of that block which is  deciding line number (input "2")

0 Kudos
Message 5 of 6
(1,639 Views)
0 Kudos
Message 6 of 6
(1,631 Views)