How can I diff two files and report the section the diff occurs in?

Posted by Les on Stack Overflow See other posts from Stack Overflow or by Les
Published on 2010-03-18T13:37:01Z Indexed on 2010/03/18 13:41 UTC
Read the original article Hit count: 343

Filed under:
|

I have two text files with several sections in them. Each section has has a header with the section name (grep can extract all the section names without extracting anything else from the file). How can I report the differences between the two files AND report the section that the difference occurs in? I would also need to be able to report added/missing sections. Ideally, identical sections would not be mentioned in the report at all.

© Stack Overflow or respective owner

Related posts about linux

Related posts about diff