in reply to RegEx : Filtering a log file

This should do the capturing you want:

#!/usr/bin/perl -w use strict; while(<DATA>){ chomp; print "$1\t$2\t$3\n" if /^(.+?\d{4})(?:.*\t){5}(.+)\t(.+)/; } __DATA__ ========== ======== ======= ==== ===== += ====== ================== START TIME END TIME VERSION USER SOURC +E STATUS STATUS DESCRIPTION ========== ======== ======= ==== ===== += ====== ================== August 26, 2004 1:21:04 AM August 26, 2004 1:22:16 AM 2. +0 system HA038974 Pending [BATCHMODE] +Started installation process September 5, 2004 2:49:03 AM September 5, 2004 2:49:37 AM + 2.0 system HA038974 Pending [BATCHM +ODE]Started installation process September 16, 2004 12:32:34 PM September 16, 2004 12:33:26 PM + 2.1 [kotzel_sup] HA038974 Pending S +tarted installation process September 16, 2004 4:44:28 PM September 16, 2004 4:44:34 PM + 2.1 [kotzel_sup] HA038974 Finished 23 + Successful, 8 Failed

It assumes tab delimiting.

TheEnigma

Replies are listed 'Best First'.
Re^2: RegEx : Filtering a log file
by Anonymous Monk on Sep 17, 2004 at 12:38 UTC
    Brilliant,...

    And Thanking you all very much, These were one ‘hellova’ responses. Now I have learnt something else to do with RegEx.



    LONG LIVE PERLMONKS

    Thanks
      I forgot to log in :-(

      Cheers

      Blackadder
        And you forgot to log in...again. :-P

        The easiest way to make sure that you know when you're logged in is to go to your user settings, search for theme, and set a logged in theme which looks very different from your logged out theme.