This example supposes that the filetype consists of 3 or 4 literal letters and the unique codes consist of 3 numbers. Of course, every filetype should have it's own code.my %suffix; open(LOG, "logfile") or die $!; while (<LOG>) { next if /^#/; $suffix{$1}++ if /.+(\.\w{3,4}\s\d{3})$/; } close LOGS; for (sort keys %suffix) { print "$_ => $suffix{$_}\n"; }
In reply to Re: Parsing a log file
by le
in thread Parsing a log file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |