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

hadi motamedi motamedi24 at gmail.com
Wed Dec 2 10:20:56 UTC 2009


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

> On 2009-12-02 10:56, hadi motamedi wrote:
> > But "#diff -y" compares the two files in line-by-line basis . But my two
> > files do not have one-to-one correspondence , say row#1 in file1 maybe
> > the same as say row#5 in file2 . So I seek a way that does not consider
> > this as a difference (but diff will consider).
>
> (( First, please do not top-post. ))
>
> "diff" would match the line2 in file1 with the line5 in file2,
> and it would mark that some lines were inserted there.
>
> I think you'll have to specify more what you mean by "compare",
> and what you think is different or same.
>
>
>
>
> --
> 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
>




Sorry . I tried for "#diff -y" but its output seems to have a comparison
between the two files in line-by-line basis . As you mentioned , if the
row#1 in file1 is in match with say row#5 in file2 I want it not to
be considered as a difference. But the the output shows it as if it is being
considered as a difference. Please correct me .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos/attachments/20091202/cd7092a5/attachment.html 


More information about the CentOS mailing list