JLatham replied to Bernard
21-Nov-09 01:45 PM
If, and it is probably a big if, each line in the text file is always exactly
the same length, you could open the file for Binary access, read through it
until you find the beginning of the line you need and replace that line with
the new data.
Barring that, the easiest way is probably to open the existing file for
input, open a second file for output, then
read a line from it,
test if it is the line your want
if not the line you want, write it to the 2nd file
if it is the line you want, write the new data to the 2nd file
and then just read and write from 1st to 2nd to the end of the 1st.
After that you can KILL the 1st file and name the 2nd one with the original
file name.