RE: Comparing 2 text files
by Jim Guion other posts by this author
Nov 11 2005 12:48PM messages near this date
view in the new Beta List Site
Re: Comparing 2 text files
|
Re: Back-slashes & calling a batch file from perl ???
Hashes are your friends!
my $file1 = "file1";
my $file2 = "file2";
my %file1_names;
open(IN1,$file1) or die $!;
while (<IN1> ) {
chomp;
$file1{$_} = 1;
}
close IN1;
open(IN2,$file2) or die $!;
while (<IN2> ) {
chomp;
print "Found matching name: '$_'\n" if $file1{$_};
}
close IN2;
-----Original Message-----
From: perl-win32-users-bounces@[...].com
[mailto:perl-win32-users-bounces@[...].com] On Behalf Of
Paul
Sent: Friday, November 11, 2005 1:49 PM
To: perl-win32-users@[...].com
Subject: Comparing 2 text files
Hi,
What is the best way to compare 2 text files for
matching. Let's say both files have just people names
Thanks
File1 File2
James Joe
Tina Patrick
Steve James
... ....
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Michael D Schleif
Michael D Schleif
Chris Wagner
$Bill Luebkert
$Bill Luebkert
Michael D Schleif
$Bill Luebkert
Michael D Schleif
$Bill Luebkert
Michael D Schleif
$Bill Luebkert
James Sluka
Ted Zeng
$Bill Luebkert
Ted Zeng
Paul
Peter Eisengrein
Trevor Joerges
Jim Guion
$Bill Luebkert
James Sluka
$Bill Luebkert
Chris Wagner
|