Perlmeisters,
I have two files,
File A contains user names (first, last names), File B contains user names with
password and email address.
A script is needed
to extract the users in File B that exist in File A. I wrote the following
script, but it stops after the first match.
I'm using
Activestate Perl build 618. File B is piped in at the shell.
open(MARK,
"marketing.csv");
@marketing = <MARK>;
close MARK;
@marketing = <MARK>;
close MARK;
foreach $user
(@marketing) {
chop $user;
while (<>) {
if (m/^$user (.*)/) {
print $1;
}
}
}
chop $user;
while (<>) {
if (m/^$user (.*)/) {
print $1;
}
}
}
Lorenzo
Murillo
Systems
Administrator
212 278
9379
