I do not read this thread from top to end.
But to answers your question, you can't just modify some data from certain position to certain position in the file easily, except you're using a database library, which they will do the complicated things in background.
One of the ways to do it is read all of them to memory, modify them in the memory and write them all back to file. Database will work smarter because they will use caching technology to speed up the all the processes.
I do not play a lot with database nor file. But I ever write my modules to handle this headache problems, and now I just use it without need to write it from zero. This is what it will do:
To substitute line no 3 with new data
1. Open File_Source for reading and open File_Target for writing
2. Repeat
3. Read a new line of data from File_Source
4. If now is line 3 then write new data to File_Target
5. If now is not line 3 then write the old data to File_Target
6. Until it reach end of file
7. Close File_Source and Close File_Target
As I already mentioned I'm not good in file/database manipulation, some experts will give you better explanations.
lainz already give a good link. But this one is good too:
http://wiki.freepascal.org/File_Handling_In_Pascal