Mac OS X's UNIX underpinnings comes with several powerful text editors: sed, awk, and perl.
Try this with sed: "sed 's/a/b/g' <filename>"(without the double quotes, of course -- leave the single ones in)
Warning: you file will be directly changed with sed, so make a copy if you wanna practice. That command will replace (as denoted by the 's' character) all occurrences (all occurrences denoted by the 'g' at the end) of the letter 'a' with the letter 'b', going through the file line by line. Without the 'g' on the end, only the first occurrence of 'a' on every line would be replaced with 'b'.
Try looking sed, awk and perl up on Google. You will find there are more than a plethora of tutorials and examples available.