mmittiga17 has asked for the wisdom of the Perl Monks concerning the following question:
Any suggestions? It appears to add the count from the last unique bankcode from the last file to the new files bankcode count. Thanks in advanceopen (logfile, ">>$LogName"); while ($line = <cfile>) { $counter++; $BankCode=(split(/\t/,$line))[0]; print "$BankCode\n"; push(@bc ,"$BankCode"); } my %count; map { $count{$_}++ } @bc; $count = return %count; map {print logfile map {print logfile "$ClientCode[$clientindex][0]\ +t$_\t$FileType[$fileindex][1]\t$CurrFile\t${count{$_}}\t$CurrZipFile\ +t$yyyymm\t$onDemand\n"} sort keys(%count); ===== $_ = the BankCode in the print line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: counting unique elements of an array
by toolic (Bishop) on Jan 30, 2008 at 17:32 UTC | |
|
Re: counting unique elements of an array
by moritz (Cardinal) on Jan 30, 2008 at 17:30 UTC | |
|
Re: counting unique elements of an array
by apl (Monsignor) on Jan 30, 2008 at 17:59 UTC |