in reply to Re: Re: Parsing Log File Help!
in thread Parsing Log File Help!
as for the counting... not sure I follow. If you're trying to count the number of times a specific value shows up in a field (i.e., number of times "company abc", "company xyz", etc. show up in the "company name" field) then perhaps something like:foreach (<LOGFILE>) { @fields = split '*', $_; # ... blah, blah, blah ... }
fits the bill...%company_count; foreach (<LOGFILE>) { ($company_name, ...) = split '*', $_; $company_count{$company_name} ++; } # foreach sort (keys %company_count) { foreach (sort keys %company_count) { print $_, " showed up ", $company_count{$_}, " times\n"; }
|
|---|