search/replace text or lines of text HTM file

October 17, 2010 at 07:36:06
Specs: Windows 7 HPrem, 2Ghz/3Gb
I currently have around 1,000 sub-folders each with about 10 .htm files.

I need to change some text within the HTM file. The search text that needs to be replaced will always be the same e.g. manchester, but the replacement text will need to be whatever the folder's called where the file is located (e.g. london).

I don't know whether to have two separate batch files, but I also need to be able to search and replace on some lines of HTML code, so for example;

<div id="header">
This is some test text at the moment but I will need some text later</div>

Hope this can be done? Thanks in advance

See More: search/replace text or lines of text HTM file

Report •

October 17, 2010 at 07:57:14
It is very hard to achieve what you need via a batch script since batch does not like html due to the presence of special characters < and > that are interpreted as re-directors for the script.

That the reason you do not get any answer: batch scripters don't love to be jammed into a coding Vietnam (today Afghanistan).

VBscript is better suited but less known than batch.

Report •
Related Solutions

Ask Question