
Pattern matching spanning more than one line and substitution between two files -
I am a perl newbie and this is what I am trying to do...very very new
at perl and trying to learn as fast as I can..
There are two text files say OldFile and NewFile
the contents are similar most of the time but some small changes occur
in the NewFile in some places. The values of the OLDFile are what I
want to keep along with any additions in the newFileFor example:
OldFile might have:
BLAH1 = 0
BLAH2 = 1
BLAH3 = 2
BLAH4 = 3
and NewFile might have:
BLAH1 = 0
BLAH2 = 5
BLAH3 = 6
BLAH4 = 3
BLAH5 = 7
BLAH8 = 9
I need to produce a third file, say ProductFile which will have
BLAH1 = 0
BLAH2 = 1
BLAH3 = 2
BLAH4 = 3
BLAH5 = 7
BLAH8 = 9
----
Also, the patten BLAH = <something> might stretch to more than one
line in the text file.
--------------------
Any suggestions on how i might do this - any short piece of code,
pseudo code, regexp for pattern matching and substitution spanning
more than one line [this is the one I am having the most problems
with] will be greatly appreciated!
Thanks for your time,
Vinod