Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Parsing a log file

by le (Friar)
on Jul 13, 2000 at 00:07 UTC ( [id://22265]=note: print w/replies, xml ) Need Help??


in reply to Parsing a log file

Maybe this will help you:
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"; }
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://22265]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2025-02-07 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.