Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$excludeaccts = "accts_to_exclude.txt"; Open(FILEHANDLE, $excludeaccts) || die ("Cannot open $excludeaccts"); %lookup = map {chomp; $_ => undef} <FILEHANDLE>; close(FILEHANDLE); $origlist = "orig_accts.txt"; open(ACCTLISTFILE, $origlist) || die ("Cannot open orig_accts.txt"); open($output, '>', 'output.txt') || die ("Cannot open output file outp +ut.txt"); while ($line = <ACCTLISTFILE>){ chomp $line; ($filename, $state, $amt, $ttl, $account, $name, $invnum) = split /\ +t/, $line; next if exists $lookup{$account}; print $output "$filename $state $amt $ttl $account $name $invnum\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: comparing lists
by GrandFather (Saint) on Feb 02, 2006 at 04:03 UTC | |
by Anonymous Monk on Feb 04, 2006 at 04:02 UTC | |
by GrandFather (Saint) on Feb 04, 2006 at 07:21 UTC | |
by Anonymous Monk on Feb 04, 2006 at 22:44 UTC | |
|
Re: comparing lists
by graff (Chancellor) on Feb 02, 2006 at 06:20 UTC |