Hi,
Looks like homework, although I'm not sure
So here are some pointers you could look into:
grep -> Look for a string in a file/variable
sed -> replace a string with something else.
Examples:
grep "dummy" some.file => greps any line containing dummy in some.file
sed 's/THEN/THAN/g' => Chnage THEN into THAN (case sensitive), on the whole line (the g).
Take a look at the manpages for all the options.
Hope this helps.