PDA

View Full Version : how to find common lines in subset of multiple files



zerop2
July 31st, 2016, 05:43 AM
if there is at least two files have common lines hope to show like this example,
perl a.pl ./*.txt

common line1 - a.txt b.txt
common line2 - a.txt c.txt d.txti searched this script, but this script only search words, not common lines
perl theScript.pl ?.dat
#! perl -nl

push @{ $h{ $_ } }, $ARGV

}{

print qq[$_ id in @{$h{ $_ }}] for keys %h;