in reply to Counting multiple values in an array...
You may want something like this (UNTESTED):
#!/usr/bin/perl use warnings; use strict; # open file my $file = shift @ARGV; open FILE1, '<', $file or die "Can't open '$file': $!"; my %caseCount; # Use a while loop to read through the data while ( <FILE1> ) { my $caseNumber = ( split /\t/ )[ 1 ]; $caseCount{ $caseNumber }++; } # close the file you don't need it any more close FILE1; #do something here with values in %caseCount
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Counting multiple values in an array...
by chromatic (Archbishop) on Jun 10, 2010 at 07:46 UTC | |
by jwkrahn (Abbot) on Jun 10, 2010 at 16:27 UTC |