You must Create a temp file and write there the data you want from your original file . Then rename the tempFile as the original's file name ( After you delete it of course )
This is the source code :
LineToReplace = X
LineToRead = 0
Open "filename.txt" for input as #1
Open "###.$$$" For Output As #2
while not eof(1)
LineToRead =LineToRead + 1
if LineToReplace = LineToRead then
strLine = "Replace With This"
else
Read #1, strLine
end if
Print #2, strLine
wend
Close #1
Close #2
Kill "filename.txt"
Name "###.$$$" As "filename.txt"
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.