The problem can arise if the new line has different lenght than original one and the values in the files are written one after the other without extra spaces. In this case the simplest thing I can think of is to create a new file with the updated content and then delete the previous one.
Some line in pseudo-code:
destH = OpenFile (NewFile) // Open in ASCII mode
srcH = OpenFile (TheOriginalFile) // Open in ASCII Mode
while (br != -2) {
br = ReadLine (srcH...)
// Scan the string
If the desired variable: Update the string
In any case: WriteLine (destH...)
}
CloseFile (srcH);
CloseFile (destH);
DeleteFile (original file)
RenameFile (new file as original one)
Hope all this is clear enough
Roberto