[HRPM] multiline match!!

Collin Cusce cusce at jlab.org
Tue Mar 13 14:15:12 CST 2001


Here's what I would do.
<code>
    $count = 1;
    $string =  "";
    @entries = ();
    while($line = YOURFILE){
        if ($count % 2){
            $string =  "";
            $string .= $line;
        }else{
            push(@entries, $string);
        }
    $count++;
    }
</code>

Be nice, I'm sure there is a better way to do this...this is just the most
obvious to me.
            Collin Cusce'
----------------------------------------------------------------------------
-------
Sir Humpherey Applebee once said:
Well Minister, if you asked me for a straight answer then I shall say that,
as far as we can see, looking at it by and large, taking one time with
another, in terms of the average of departments, then in the final analysis
it is probably true to say that, at the end of the day, in general terms,
you would find, that, not to put too fine a point on it, there probably
wasn't very much in it one way or the other, as far as one can see, at this
stage.
----------------------------------------------------------------------------
-------
----- Original Message -----
From: "Santiago Nieva" <sgalayar at yahoo.com>
To: <norfolk-pm-list at happyfunball.pm.org>
Sent: Tuesday, March 13, 2001 2:27 PM
Subject: [HRPM] multiline match!!


> Hi everybody,
> I failed this morning trying to filter a log that has
> "two line entries" like this:
>
> 2001-03-07 msgID=4875876856     <--- line with date,
> hour
> User "nnnnnn" does not exists   <--- explanation text
> 2001-03-07 msg.....
> The applica....
>
> What I wanna do is to get the "pair" filtered by date
> and explantion text. p.e collect all entries with date
> "xxxx" and text "not exists".
> Thnaks in advance
> santi
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>




More information about the Norfolk-pm mailing list