Re: Comparing 2 Unix files but ignoring line numbers

From: William Park (opengeometry@yahoo.ca)
Date: 04/04/03


From: William Park <opengeometry@yahoo.ca>
Date: 3 Apr 2003 22:34:10 GMT

cobilan <member25768@dbforums.com> wrote:
>
> Is there a command, script, or function in Unix in which one can compare
> 2 files but ignore the line numbers in each file.
>
> Example:
>
> File1
>
> 1 Program Name: Test1
> 2 Author: John Doe
> 3 Description: This is a test program.
> 4 ...
> 5 ...
>
>
> File2
>
> 10 Program Name: Test2
> 20 Author: John Doe
> 30 Description: This is a test program.
> 40 ...
> 50 ...
>
> I'd like to compare File1 and File2 from above. The output should show
> that the first line is the only line that is different in the 2 files.
>
> It's like doing a SUPERC of 2 files on the mainframe.
>
> Any ideas?
>
> Cobilan

Is there any reason why you can't strip the line numbers and use
temporary files?

-- 
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>
Linux solution for data management and processing. 


Relevant Pages

  • Re: Comparing 2 Unix files but ignoring line numbers
    ... > Is there a command, script, or function in Unix in which one can compare ... > 20 Author: John Doe ... This is a test program. ... diff the temp files, return results, rm temp files. ...
    (comp.unix.shell)
  • Re: Comparing 2 Unix files but ignoring line numbers
    ... cobilan wrote: ... > Is there a command, script, or function in Unix in which one can compare ... > 20 Author: John Doe ... This is a test program. ...
    (comp.unix.shell)
  • Re: Word Field in Mail Merge?
    ... The reason most people here prefer to use the "direct approach" to inserting ... What's throwing me is the "Compare To" section ... Doug Robbins - Word MVP ... Mr.MERGEFIELD John Doe ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Removing White Space...
    ... > The last two I recognise, but I don't remember seeing that top one. ... > If you compare them term for term, for the task they were intended, ... I haven't validated it yet (my test program is too slow) but the next ... the failure points start to go back down. ...
    (microsoft.public.vb.general.discussion)
  • Re: Word Field in Mail Merge?
    ... That brings me to the IF-THEN-ELSE wizard. ... What's throwing me is the "Compare To" section ... Doug Robbins - Word MVP ... Mr.MERGEFIELD John Doe ...
    (microsoft.public.word.mailmerge.fields)