mcallaghan
IS-IT--Management
The situation I am having is I have 2 files and I am comparing the difference between the 2 files and reporting it to a log. The return value is something like this.
\---[changed 13]---------|-----[changed to 13-15]------
aaa |bbbb
I would like to add on to this process which would grab the line numbers before and after the changed line. In this example it would seek through my log file and find lines 13-15 I would like to grab lines above and below it and throw that into a file along with the differences. The file in this situation would grab lines 10 through 20.
Take note of this the original diff file can have multiple changes to lines. So the original log can return a value like this.
\---[changed 13]---------|-----[changed to 13-15]------
aaa |bbbb
\---[changed 20]---------|-----[changed to 20]------
bbb |cccc
So i would like to grab the lines above and below 13-15 as well as the lines above and below 20 as well.
\---[changed 13]---------|-----[changed to 13-15]------
aaa |bbbb
I would like to add on to this process which would grab the line numbers before and after the changed line. In this example it would seek through my log file and find lines 13-15 I would like to grab lines above and below it and throw that into a file along with the differences. The file in this situation would grab lines 10 through 20.
Take note of this the original diff file can have multiple changes to lines. So the original log can return a value like this.
\---[changed 13]---------|-----[changed to 13-15]------
aaa |bbbb
\---[changed 20]---------|-----[changed to 20]------
bbb |cccc
So i would like to grab the lines above and below 13-15 as well as the lines above and below 20 as well.