in reply to Re: comparing two files for duplicate entries
in thread comparing two files for duplicate entries
or, just slightly different:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"one who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever."
mk at perl dot org dot br
open(FILE1, "file1"); open(FILE2, "file2"); while(<FILE1>){ /(\S*)\s+(\S*)/; $hash{$1}=$2; } while(<FILE2>){ /(\S*)\s+(\S*)/; print "$1 $hash{$1} $2\n" if $hash{$1} }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"one who asks a question is a fool for five minutes; one who does not ask a question remains a fool forever."
mk at perl dot org dot br
In Section
Seekers of Perl Wisdom