The good thing about your question is that you are dealing with fixed strings, not regular expressions ... which makes the problem relatively simple. You can write something to do this job without too much trouble.
The solution I'm connected to is not optimal, but it works, and it does not depend on matching only open / close strings (i.e. only replaces literal matches). Main idea:
- Read in the file that determines what we are looking for,
- Read in the file that defines our replacement,
- Iterate over all other arguments, search for a search string, and replace it with replacement text
source share