Regular Expressions? PHP? Existing App?
August 29, 2005 1:58 PM Subscribe
I have a bunch of directories of static HTML files in which I need to:
-> Find A
-> Find B
-> Replace A with B
-> Save, close, repeat with every one of the 500 or so files.
Anyone got an idea?
I've written some PHP functions that will do the find and replace bit but I'm having a bitch of a time figuring out how to run the script across my whole file system.
posted by TiggleTaggleTiger to computers & internet (21 answers total)
It would then need to look like this:
<title>Unique H4 tag contents</title>
Blah, blah, blah...
<h4>Unique H4 tag contents</h4>
perl -p -i -e 's/A/B/g' *.html
I'm sure this is obnoxiously terse, but if you can use perl, this is all you need.
posted by xueexueg at 3:18 PM on August 29, 2005