monger has asked for the wisdom of the Perl Monks concerning the following question:
PROC PRINT will print a neat, counted chart of an input file. For example, when reading a log file recording subsystem logons, it will print a chart containing the following headings:
LOGON DATE IP ADDRESS BEGIN TIME END TIME COUNT REASON
The bugger here is the Count function. I would like to feed perl a log file where I can count all attempted logons using a single id. For example:
xzc6548 192.168.10.5
xzc6548 192.168.10.5
xzc6548 192.168.10.10
These fields, along with the others omitted would be printed as follows:
LOGON -- IP -- CNT ........
xzc6548 -- 192.168.10.5 -- 2 ........
xzv6548 -- 192.168.10.10 -- 1 ........
I've been working with perl and log files for a while now, but getting to this level of output escapes me right now.
Any suggestions?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl equivalent to SAS PROC PRINT
by si_lence (Deacon) on Jan 05, 2005 at 16:09 UTC | |
|
Re: Perl equivalent to SAS PROC PRINT
by osunderdog (Deacon) on Jan 05, 2005 at 16:03 UTC | |
|
Re: Perl equivalent to SAS PROC PRINT
by xdg (Monsignor) on Jan 05, 2005 at 18:40 UTC |