in reply to find common data in multiple files
If you do:
my %hash; ++$hash{ $_ } while <>;
It will add and increment an entry in the hash for each line of every file named on the command line.
Then all you need to do is run through the hash and print out any key with a value equal to the number of files:
$hash{ $_ } == @ARGV and print for keys %hash;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: find common data in multiple files
by Laurent_R (Canon) on Dec 28, 2017 at 11:18 UTC |