Since the very early days, the MySQL distribution packages contain a very useful commandline-tool named replace. As the name implies, it can be used to replace strings in text files. From the documentation:
The replace utility program changes strings in place in files or
on the standard input. Invoke replace in one of the following
ways:
shell> replace from to [from to] ... -- file [file] ...
shell> replace from to [from to] ... < file
from represents a string to look for and to represents its replacement. There can be one or more pairs of strings. Use the -- option to indicate where the string-replacement list ends and the filenames begin. In this case, any file named on the command line is modified in place, so you may want to make a copy of the original before converting it. …
[Read more]