Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Counting incidents of names in a file

by Bishma (Beadle)
on Feb 13, 2002 at 22:46 UTC ( [id://145306]=note: print w/replies, xml ) Need Help??


in reply to Counting incidents of names in a file

Ok, with your help I think I managed to find a solution. It's a little sloppy, but I'll clean it up later.
@classes = qw/ class1 class2 class3/; foreach (@classes) { my %kboard; print "_ $_ _<BR>"; for ($i = 0; $i <= $#scoredata; $i++) { @logdata = split /\|/, $scoredata[$i]; if ($logdata[4] eq $_) { $kboard{$logdata[0]}++; } } for (keys %kboard) { print "$_ = $kboard{$_}<BR>\n"; } print "<BR><BR>"; }

@scoredata is what I read my data file into. Thanks again everyone.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://145306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found