in reply to Parsing a Flat File and counting occurances of numbers?
Hrm, looking at your post history it would seem all your questions so far are somehow related to lines like these. Are you making progress I hope? The following code demonstrates the basic ideas you'll probably employ, but you'll need to make a few changes too I think.
my %range_counts = (); my %counts = (); while( $entire_file =~ m/(\d+)bn(\d+), bytes/sg ) { $range_counts{'4kset'} ++ if $2 > 4000 and $2 < 6000; $counts{$2} ++ if $2 > 4000 and $2 < 6000; } print "there were $counts{'4kset'} 4000-6000 lines\n";
I suspect you'd also benifit from pouring the results into a database of some kind. Then you could run queries like SELECT sum(something_column), avg(something_column) FROM data WHERE something>something and something < something and report on all kinds of interesting details.
-Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a Flat File and counting occurances of numbers?
by chargrill (Parson) on Dec 22, 2006 at 14:00 UTC | |
by batcater98 (Acolyte) on Dec 22, 2006 at 14:12 UTC |