Edit a specific line in a text file

S

Shimmy

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
 
L

Larry Linson

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").
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top