i would suggest load the file and write each line as it is but only write for the wanted line the new line
so just load full content of a file and modify the text where you want and save it back as whole file
if you know exactly the byte position yes.. but if not then i would do it in that way:
read line for line while you get a line just check if you want to replace that one if not then write it in a temporary file when you finished that then just delete the old one and rename the temporary file to the filename of the old one
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.