Scourgify is a perl script for massive search and replace work on a file. You can define a set of search and replace rules in a configuration file, then use those rules on any text file used as an input. Additionally, you can add a header and a footer to the input file and constraint the output to be cut in lines of less than n characters (without breaking words).
You can download the script here. A tutorial is to come when I have the time to write it.