You can not simply insert stuff into existing lines of a text file. Instead, you have to completely rewrite the file. Open the original file for reading, open a new temp file for writing. In a loop, read each line of the original file and rewrite it with desired changes to the output file. After that is done, close both files, delete the original, and rename the temp to be the same name as the original.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343