You basically need to open the file and read the file until you get to
the specific row you are looking for then write the new file and close
the file. there are at least 3 methods of accomplishing this.
1) Open the file in Append Mode. The Append Mode will read and write
data to the same file. See webpage below
'OPEN statement'
(
http://www.powerbasic.com/support/he..._statement.htm)
2) Open and Input and create a new Output file. Make the changes and
close both files. Then delete the original file. Finaly move the new
file to the old file name.
3) Read the text data into excel putting each row into a single column.
Make the changes you need. Then save the data back into the original
file. the advantage of putting it into a worksheet is you can use the
FIND() method for locating the data you are looking for. Using excel is
less efficient then the other mtwo method becasue it take mor etime and
memory, but writing the code may be easier.
I say may be easier because using excel you would have to read the data
into excel and the output it again which is two extra steps. Also excel
is notorious for for manipulating data when you don't want it to.
Especially reading and writing text data to files. Excel in CSV files
adds double quotes to data (sometimes don't when you do want it to),
performs Text-To-Columns when you don't want it to. I've found lots of
odd things that occur.
--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/sh...d.php?t=174833
Microsoft Office Help