-----Original Message----- >From: [EMAIL PROTECTED] >Sent: Aug 9, 2007 11:12 PM >To: beginners@perl.org >Subject: Find and replace from CSV > >Hi, I am new to Perl. > >I am trying to replace a string within a bunch of html files. > >Ideally, I would like to have the file name pulled from a list in a >text file, open the file, search for the string that will be replaced >within the file, pull the replacement string from another file, then >replace the string, close the file and move on to the next one. > >Does anyone know of a good place to find an existing script I can >modify for my purposes? >
Make one for you using both shell and perl,:) #!/bin/sh FILE=$1 REPLACED=$2 REPLACEMENT=$3 perl -pi.bak -e 's/\Q$REPLACED\E/$REPLACEMENT/' $FILE echo "DONE" ------ HTH. -- Jeff Pang <[EMAIL PROTECTED]> http://home.arcor.de/jeffpang/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/