I often use
M-x replace-regexp and
M-x occur with some fixed regexp pattern and replacement string on many files.
Doing it manually by opening each file in an Emacs buffer and hitting the keys is very tedious. I was wondering how to write an Elisp function to use as a script, which I can apply to each file?