in reply to Re^4: diff not working as it should
in thread diff not working as it should

you have two lines of code, so it should be easy to choose... start just in the third line

open the output file enter a loop reading line by line print only the matching lines close and reopen send it again to the file and you have it.

Replies are listed 'Best First'.
Re^6: diff not working as it should
by tale051258 (Initiate) on Dec 23, 2011 at 21:04 UTC
    Yes, I understand -- and have gone ahead -- and did the regex with some extra code after the diff(). And I thank you for your input.
    I was just wondering if there was some way to do the regex within the diff command or diff command options (I don't see anything at first glance.)
    Cheers!

      Well, maybe I can save you some work. If you want to do this, I suggest you to use Algorithm::Diff in its place

      The example script "diff.pl" provided with the module Algorithm::Diff does exactly what you want and is ready to use. You will find it in the directory after unzip and untar this package (you will need to install the module before to be able to use it, of course):

      diff.pl file1 file2 ___ 5+ this is the line 5 (in file 1) 5- this is the lime 5 (in file 2)