|
-
Nov 23rd, 2005, 02:38 PM
#1
Thread Starter
Lively Member
Seach & Replace Through .HTM Files
Oi,
I have to write an app which will search through various "HTM" files and look for certain text and then replace it accordingly.
I have been researching for some time I am unsure how to start this, I have a few "Search & Replace" programs but I need to make my own.
If anyone can shed some light on this matter or point me in the correct direction I would appreciate you help.
Thanks...
"That is just it: you must have the devil in you to succeed in any art."
-
Nov 23rd, 2005, 02:53 PM
#2
Re: Seach & Replace Through .HTM Files
Well if you read the text into a string you can then use the string's Replace method, passing the search phrase and replacement phrase, to replace the text.
-
Nov 23rd, 2005, 02:56 PM
#3
Fanatic Member
Re: Seach & Replace Through .HTM Files
Yeah, you'd have to do it the way penagate describes. After you do a replace, you would overwrite the original file and write out the new big string all at once, flush the writerstream, and finally close it.
-
Nov 23rd, 2005, 03:22 PM
#4
Re: Seach & Replace Through .HTM Files
One word... Regex... now its a matter of finding out what types of strings you need to find...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|