You can use Perl to quickly search and replace text across multiple files. For example to replace foo with bar all text files:
perl -pi -w -e 's/foo/bar/g' *.txt
as seen here.