Try man sed for everything (almost) you wanted to know about sed (Serial EDitor). You want something like this:
sed -e s/what_U_R_looking_4/what_U_want_it_2_B/ file1 > file2
This says:
run sed
-e means evaluate this expression
s/x/y/ means search & replace (where x = a regex or pattern to be changed and y = a regex or pattern you want to end up with)
file1 is input file
file2 is output file
You can do this inplace but if you screw up, your original file is gone!
If you need more info on regexes, see man 7 regex or you can go to
The Regex Coach and download the "coach" to learn more about regexes and how to use them.
PERL will be a much more eloquent solution and is probably already installed on your system. It's the "swiss-army knife" of programming languages and is very well suited to text manipulation. See
perl.org for info on PERL. If it is not installed on your system, see
Active State for distributions for just about any platform.
HTH!