![]() |
|
P is for Practical | |
PerlMonks |
Re: Parsing a log fileby nuance (Hermit) |
on Jul 13, 2000 at 00:19 UTC ( [id://22269]=note: print w/replies, xml ) | Need Help?? |
You've said you know how to read the files and get the lines etc. so I'm just going to do the other bits. First you want to split the data to extract the path to the file and the number at the end. You can use split to do this:
This will give you and array with the path to the file in $bits[3] and the number in $bits[4]. Next you must extract the file type from the path to the file.
I would then use a hash to store these:
The first time you reference a type/ number combination it will be created with a value of one, each time after that the number gets incremented and so it keeps a count of how many times each combination occurred. At the end of the script you can get the data with:
Nuance
In Section
Seekers of Perl Wisdom
|
|