Find and Replace Text Across Multiple Files?

cgp314

Registered
I have a load of HTML files I need to make identical changes to. There are far too many to do it manually, so I was wondering if anyone knows of grep-like command that I can use to find and replace text across multiple files.

Thank you in advance for your help,

-Colin
 
Pardon my ignorance, but I thought grep was only able to match text strings in files, not replace them.
 
Find the (discontinued) version of BBEdit Lite and use its multifile search capabilities. It even supports grep.
 
MassReplaceIt (at VersionTracker)
Actually, the 2.0 version is here:
http://www.hexmonkey.brownhost.com/ (versiontracker is apparently out of date...)

lets you select the files you want to search, and set the text you want to search for and tehn replace. even tells you teh docs and the number of changes to each doc before you apply the replace.

very cool.
UI is very minimalistic, but it's not hard to figure out.
 
Isn't awk also good enough?

If you have a lot of identical text/code in your (X)HTML perhaps you should consider using PHP (make files with the identical text and include them via PHP in your pages).
 
use Perl;

If it's a simple change maybe you can post it here, and we can work out a one-liner. Otherwise, I'd say your best bet is to spend a few hours learning Perl (it pays off in the end).
 
Back
Top