Edit a specific line in a text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Line 50 of my text file says "default =" . I want to edit this line to what a user types in to a textbox (ie. if user types "54" into the control the line would now read "default =54").

Any help is appreciated.

Shimmy
 
And you want this written back to the text file?

Use the classic file I/O: Open and LineInput and Print #, to Copy each line
to a new text file, up to the line you want to change. Read in this line,
append the numbers you want (in your example "54") So that it reads
"default=54", use Print # to write it out to the new file. Then copy each
line until the input text file reaches EOF.

Larry Linson
Microsoft Access MVP


Shimmy said:
Line 50 of my text file says "default =" . I want to edit this line to
what a user types in to a textbox (ie. if user types "54" into the control
the line would now read "default =54").
 
Back
Top