Consider the following two files that are slightly different:
foo
(old version):
<Line 1> a
<Line 2> b
<Line 3> c
<Line 4> d
foo
(new version):
<Line 1> a
<Line 2> e
<Line 3> b
<Line 4> c
<Line 5> f
<Line 6> d
As you can see, characters e
and f
are introduced in the new file.
I have a set of line numbers corresponding to the older file…say, 1
, 3
, and 4
(corresponding to letters a
, c
, and d
).
Is there a way to do a mapping across these two files, so that I can get the line numbers of the corresponding characters in the newer file?
E.G., the result would be:
Old file line numbers (1,3,4) ===> New File line numbers (1,4,6)
Unfortunately I have only emacs (with a working ediff), Python, and winmerge at my disposal.