Mar 24, 2011, 9:39 AM
Post #1 of 2
Need help creating a script that reads in multiple files for regex search..replace
I need some help writing a perl script which reads in a series of .htm files, all in the same directory, and executes a regex search..replace on each file. For the replacement, I want the text to be from another file. I am using Windows XP and Strawberry Perl, FYI.
The text for the replace will come from this file:
Way too much text to print in this post, but it is html and will be cut and pasted from another file that I presumably must read in
And the regex will be something like:
s~<html><head></head><body>~Way too much text to print in this post, but it is html and will be cut and pasted from another file that I presumably must read in~ test.htm
# loop through each htm file in a directory
I would sincerely appreciate some help with this. Thank you.