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


Yes, you've got my point there at the end of your response.
I just want the one line with the asterisk to show (and the header at the top with the file names and dates). I want the other two lines (after the asterisk line) that are identical not to appear in the output. You mentioned I could do that by '... changing the format...'. How does one do that?
Cheers!

Replies are listed 'Best First'.
Re^3: diff not working as it should
by pvaldes (Chaplain) on Dec 23, 2011 at 17:44 UTC
    Play with the STYLE option, or simply apply a grep or a regexp m!(^\|\||^\*)! to the output line by line
      Not seeing much on the STYLE option.
      I can use the regex m/(^\*)/ and that gives me what I need for the most part.
      But where in the code can I use this regex? That is, can it be used as part of the diff command, as in { sub (m/(^\*)/) } ? (yes, I know this is not syntactically correct but you get the idea.)
      Cheers!

        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.