Filter arry

Discussion in 'Perl' started by Freddy Drogt, Jan 29, 2004.

  1. Freddy Drogt

    Freddy Drogt Guest

    Hello,

    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
    Partfile: doc.zip

    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.";
    Freddy Drogt, Jan 29, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bq
    Replies:
    0
    Views:
    2,544
  2. Hari

    FIR Filter

    Hari, Jan 27, 2004, in forum: VHDL
    Replies:
    3
    Views:
    903
  3. systolic
    Replies:
    6
    Views:
    641
    rickman
    Oct 24, 2004
  4. zax75
    Replies:
    1
    Views:
    1,095
  5. David
    Replies:
    1
    Views:
    95
    David
    Nov 12, 2006
Loading...

Share This Page