Sign in to follow this  
Followers 0
alucard

write to a specific line

3 posts in this topic

Hi,

does it exist a command to write a string to a specific line in a text file

thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'm not sure if there is, but if there is no simple way to do it then one workaround is to:

  • read the previous lines from the file into a variable,
  • add the new line to the end,
  • read the remaining lines from the file into the variable and then
  • write the output back to the file.
Edit: this technique will only work if you know which line number you wish to work with. Edited by LxP

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Can you explain your problem alittle better ?

Do you know the infomation or any keyword that would only be displayed on this specific line.

Edited by Nova

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0