how wouldi change all occurances of that to they regardless of the number of times it appears on a line?
Replace First:
# echo "abcabcabcabc" | sed 's/ab//'
cabcabcabc
Replace all on a line:
# echo "abcabcabcabc" | sed 's/ab//g'
cccc
using Perl:
perl -pi -e 's/that/they/g' /foo/bar