I would like to merge two text files based on some criteria driven by
Basically, this is what I'd like to achieve:
Contents of file 1:
Contents of file 2 (defines the anchors and their contents):
[anchor1]This is some text for anchor 1.
[anchor2]This is some text for anchor 2.
The file which is the result of the merger process should look like
abc This is some text for anchor 1.
ghi This is some text for anchor 2.
I'd like to define the anchors as regular expressions (identifying a
single line in file 1 or a range of multiple lines). Here, [anchor1]
is a regular expression which identifies the text "abc" in file 1.
Of course, "abc" might occur several times in file 1. To clearly
identify one particular instance of "abc" multiple identification
criteria might be required.
The basic idea is to merge comments in a fully automated manner to
some kind of source code, configuration file and the like.
I think of writing a Perl script for this but before doing that, I'd
like to check if there are other solutions/tools around. The plattform
If scripting it in Perl, are there any special Perl modules around for