Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Filter arry

Thread Tools

Filter arry

Freddy Drogt
Posts: n/a

I have a logfile and I want to make statistics of it. I have my logfile put
i a array and ech ellement of the array is a virus detection. I want to
create a log in the follow format: month: XXX detectet virus: 999.

How can I solve this in PERL:

Logfile part which is a ellement in a array:

Wed Jan 28 15:22:33 2004
Sender: <jack@xx>
Recipient list: <sandra@yy>
MessageID: 10752997486
Virus: W32/Mydoom@MM
Action: Deleted and Quarantined

My current script to put each virusevent in a ellement of a array:
open (logfile, "c:/temp/log-antivirus/log.log") or die "Fout!...:$!\n";
while (<logfile>)
$string .= $_;
@array = split(/\n{2,}/, $string); # opsplitsen logfile op lege regels
print $array[1]; #print one virusdetection
#print "\n\@array has " . ($#array + 1) . " elements.";

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Polarising filter with UV filter? Stimp Digital Photography 23 11-17-2006 11:51 AM
Remove arry entry from multidimensional array David Javascript 1 11-12-2006 11:55 PM
to filter of not to filter Ken Digital Photography 2 12-23-2005 12:45 PM
help on 2-d arry .vs. register file systolic VHDL 6 10-24-2004 10:07 PM
UV Protector filter vs. Skylight filter? john Digital Photography 8 06-26-2004 03:44 PM