Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: Count and List Items in a List

by Tech77 (Novice)
on Nov 02, 2005 at 19:32 UTC ( #505070=note: print w/ replies, xml ) Need Help??

in reply to Re: Count and List Items in a List
in thread Count and List Items in a List

Hey, This is great! Thank you, and thanks to all the other folks who responded. I did this based on the code:

open (FILE, "userstab.txt") || die "Cannot open file.\n"; open (NEWFILE, ">results.txt") || die "Cannot find or open file for ed +iting.\n"; my %count; while (<FILE>) { if (m/zaps/i) { my $zapschool = (split(/\t/))[4]; ++$count{$zapschool}; } } foreach (keys(%count)) { print NEWFILE "$_: $count{$_}\n"; } close NEWFILE; close FILE; print "Done!\n";

Comment on Re^2: Count and List Items in a List
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2015-11-26 01:31 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls