Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Company Name*345467*YW34567c*activitype*04/15/2004*11:34:10*123456789* +1 Company Name Other*345467*YW34567c*activitype*04/15/2004*11:34:10*1234 +56789*3
foreach (<LOGFILE>){ if (/^(.*?)*(.*?)*(.*?)*(.*?)*(.*?)*(.*?)*(.*?)*(.*?)$/gi){ #prin +t starting at the date push (@logg,$1); } } my %count; my $total_count; foreach my $element( @logg ) { #4 ++$count{$element}; $total_count++; } #Sort hash by its values foreach my $element (sort {$count{$a} <=> $count{$b}} keys %count){ print "Name: $element<font color=red size=\"2\">Shows:<b>$count +{$element}</b></font> times.<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regular Exp. Problem!
by allolex (Curate) on Apr 15, 2004 at 11:11 UTC | |
by Anonymous Monk on Apr 15, 2004 at 12:19 UTC | |
by allolex (Curate) on Apr 16, 2004 at 06:53 UTC | |
|
Re: Regular Exp. Problem!
by matija (Priest) on Apr 15, 2004 at 10:48 UTC | |
|
Re: Regular Exp. Problem!
by ishnid (Monk) on Apr 15, 2004 at 10:51 UTC |