diff -y ?<br><br><div class="gmail_quote">On Wed, Dec 2, 2009 at 7:42 PM, Simon Banton <span dir="ltr"><<a href="mailto:centos@web.org.uk">centos@web.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">At 08:54 +0000 2/12/09, hadi motamedi wrote:<br>
>Dear All<br>
>Can you please do me favor and let me know how can I compare two<br>
>files but not in line-by-line basis on my CentOS server ? I mean say<br>
>row#1 in file1 has the same data as say row#5 in file2 , but the<br>
>comm compares them in line-by-line basis that is not intended . It<br>
>seems that the diff cannot do the job as well<br>
<br>
</div></div>This'll show you which lines are common to both files, and for the<br>
ones that aren't which file they're in.<br>
<br>
perl -MData::Dumper -le 'while(<>) {chomp; push @{$s->{"$_"}},<br>
$ARGV}; END{ print Dumper($s) }' file1 file2<br>
<br>
... someone will be along shortly with a more elegant method.<br>
<br>
HTH<br>
<br>
S.<br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</blockquote></div><br>