Re: Comparing 2 Unix files but ignoring line numbers
From: William Park (opengeometry@yahoo.ca)
Date: 04/04/03
- Next message: F.marchioni: "Re: tar of files older then n days"
- Previous message: F.marchioni: "Re: a NOT recursive find"
- In reply to: cobilan: "Comparing 2 Unix files but ignoring line numbers"
- Next in thread: Juergen Heck: "Re: Comparing 2 Unix files but ignoring line numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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.
- Next message: F.marchioni: "Re: tar of files older then n days"
- Previous message: F.marchioni: "Re: a NOT recursive find"
- In reply to: cobilan: "Comparing 2 Unix files but ignoring line numbers"
- Next in thread: Juergen Heck: "Re: Comparing 2 Unix files but ignoring line numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|