I have looked back over past threads but can't seem to find a solution to my problem.

I understand how to write into text files and how to read out of them, my problem is being able to amend a particular line.

Is there a way to pull out a line change it and put it back into the same line.

i.e.

In text file have

Line1
Line2
Line3
Line4

I want to be able to change maybe line2 to Fred so that the text file after the changes would read

Line1
Fred
Line3
Line4

I hope you understand what it is that I am trying to do.

Cheers for any help
Steve