Comparing 2 Unix files but ignoring line numbers

From: cobilan (member25768@dbforums.com)
Date: 04/03/03


From: cobilan <member25768@dbforums.com>
Date: Thu, 03 Apr 2003 20:38:19 +0000


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

--
Posted via http://dbforums.com


Relevant Pages

  • Re: Need help comparing lines in two files
    ... The only really difference is that I didnt want to compare one FILE2 to FILE1 ... As Dan showed: ...
    (perl.beginners)
  • RE: help with loops
    ... only comparing the last line of file1 with all lines of file2. ... for line1 in file1.readlines: ... I was trying to compare each line of file1 with each line of file2. ...
    (comp.lang.python)
  • diff of two files
    ... I want to compare the two files in Perl. ... output which are there in file2 not in file1 as I know that rest of the ...
    (perl.beginners)
  • RE: help with loops
    ... I was trying to compare each line of file1 with each line of file2. ... or if you just want to compare line1 of ...
    (comp.lang.python)
  • 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)