All ASCII files are fundamentally sequential files (unlike the mainframe
file systems). Therefore, if you want to replace one set of text with
another, you can either leave enough room in the 'line' for changes, and
change the entire line at a time (fixed width direct access) or you can read
the entire file into memory, replace the parts you want to replace, and
write the entire file back out (by far the more common approach).
The choice is yours.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Stephen" <st********@hotmail.com> wrote in message
news:Oe**************@TK2MSFTNGP11.phx.gbl...
Hi All,
is it possible to read a file and write to the same file but the condition
is:
1. suppose there is a line "Today is Wednesday. A beautiful day" and I
want
to change it to "Today is Thursday. A beautiful day"
Thanks,
Stephen