[CentOS] Inquiry:How to compare two files but not in line-by-line basis?

hadi motamedi motamedi24 at gmail.com
Wed Dec 2 10:24:03 UTC 2009


On Wed, Dec 2, 2009 at 10:16 AM, Paul Bijnens
<Paul.Bijnens at xplanation.com>wrote:

> On 2009-12-02 11:10, hadi motamedi wrote:
> > Thank you very much for your reply . This code actually solved my
> > problem and returned exact matches between the two files (irrespective
> > of their location in the files) . As I understood , it will list each
> > data showing to which file it belongs (or it is common to both files) .
> > It is really what I wanted .
>
> (( do not top-post ))
>
> You could do the same by first sorting the two files, and then use "comm".
>
>
> --
> Paul Bijnens, Xplanation Technology Services        Tel  +32 16 397.525
> Interleuvenlaan 86, B-3001 Leuven, BELGIUM          Fax  +32 16 397.552
> ***********************************************************************
> * I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, ^^, *
> * quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, ~., *
> * stop, end, ^]c, +++ ATH, disconnect,  halt,  abort,  hangup,  KJOB, *
> * ^X^X,  :D::D,  kill -9 1,  kill -1 $$,  shutdown,  init 0,  Alt-F4, *
> * Alt-f-e, Ctrl-Alt-Del, Alt-SysRq-reisub, Stop-A, AltGr-NumLock, ... *
> * ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
> ***********************************************************************
> _______________________________________________
>  CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>


The two files are assorted ones , but the comm will compare them in
line-by-line basis . If row#1 in file1 is equal to say row#5 in file2 , so I
want it not to being considered as a difference .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos/attachments/20091202/f5d1ecd1/attachment.html 


More information about the CentOS mailing list