Sed, awk, perl
http://www.grymoire.com/Unix/Sed.html
http://www.gnu.org/software/gawk/manual/gawk.html
http://www.perl.org/