The Perl script fileedit.pl is a standalone utility that is very useful for performing global edits of text files.
fileedit.pl