Forum Moderators: phranque

Message Too Old, No Replies

Multiple Search & Replace Tool

         

nakulgoyal

1:02 am on Sep 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have 5000 .aspx files on my machine and I need to do a couple search and replace commands.

EG:

Remove all instances of the city name

Boston
Chicago
Los Angeles
etc...total around 100

One way to do is, 1 at a time. Is there a software/tool that can take my input in one box and remove/replace all my search and replace instances? Basically a tool that can do my multiple search and replace commands in 1 go.

physics

6:26 am on Oct 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would use a combination of shell scripting and perl. For example:

find ./ -name "*.aspx" -exec find_replace.pl {} \;

Then find_replace.pl would have code in it like:

$cities = "(Boston¦Los Angeles¦...)";
$line =~ s/$cities//;