|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Re^3: (thoughts on) Detect common lines between two files, one liner from shellby Anonymous Monk |
| on Dec 23, 2004 at 13:31 UTC ( [id://417182]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
This should also work for an arbitrary number of files, which AFAIK has no equivalent UNIX command. To show common lines in 4 files:
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /32+1+0$/' fileA fileB fileC fileD
In Section
Cool Uses for Perl
|
|
||||||||||||||||||||||||||||