Posted January 27, 2014on:
First time really coming up with a sed command myself 🙂
This page has a great introduction on the command.
sed -n ‘/|string|/p’ input_file | wc -l (print out matching lines and count its number, note: not using -n seems to produce wrong results)
sed -i.bak ‘s/|”string[[:cntrl:]]?\?”|/|string|/’ input_file (in place replacement of matching string, have to add -i.bak, otherwise input_file will be wiped out)