By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,978 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,978 IT Pros & Developers. It's quick & easy.

Writing into a text file

P: n/a
Bob
Hi,

I have an existing ASCII file.
I need to search for a value in the file and then replace the value by
another one.

Is this possible or do i have to re-write the whole file ?

Thanks.
Jan 29 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,
"Bob" <no****@nospam.orgwrote in message
news:u8**************@TK2MSFTNGP02.phx.gbl...
| Hi,
|
| I have an existing ASCII file.
| I need to search for a value in the file and then replace the value by
| another one.
|
| Is this possible or do i have to re-write the whole file ?

If both strings (replaced & replacing ) are of the same length you could
replace it in-place.
Otherwise you will have to rewrite the complete file.

I advise you for the second solution just in case and to be future-proof.
--
Ignacio Machin
machin AT laceupsolutions com
Jan 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.