Re: Parsing qmail-qread data

2007-09-02 Thread Ron Bergin
On Aug 31, 6:05 pm, [EMAIL PROTECTED] (Chris E. Rempola) wrote: > I'm trying to parse qmail-qread data, but don't know how to find the > number of occurrences after a particular string. Here is the data: > > +++ Beginning of data + > 28 Aug 2007 17:0

Re: Parsing qmail-qread data

2007-09-02 Thread Chas Owens
On 9/2/07, Chas Owens <[EMAIL PROTECTED]> wrote: > On 9/2/07, Chris E. Rempola <[EMAIL PROTECTED]> wrote: > > Thanks for all your help thus far. If I wanted to view the numbers to > > the right of the pound sign(#) also, how would I go about doing that? > > Is creating another value to the key the

Re: Parsing qmail-qread data

2007-09-02 Thread Chas Owens
On 9/2/07, Chris E. Rempola <[EMAIL PROTECTED]> wrote: > Thanks for all your help thus far. If I wanted to view the numbers to > the right of the pound sign(#) also, how would I go about doing that? > Is creating another value to the key the right idea? snip >if ( /#.*\d+\s+\d+\s+(\S*)

Re: Parsing qmail-qread data

2007-09-02 Thread Chris E. Rempola
Thanks for all your help thus far. If I wanted to view the numbers to the right of the pound sign(#) also, how would I go about doing that? Is creating another value to the key the right idea? +++ Beginning of data + 28 Aug 2007 17:00:47 GMT #88

Re: Parsing qmail-qread data

2007-09-02 Thread Ron Bergin
On Aug 31, 6:05 pm, [EMAIL PROTECTED] (Chris E. Rempola) wrote: > I'm trying to parse qmail-qread data, but don't know how to find the > number of occurrences after a particular string. Here is the data: > > +++ Beginning of data + > 28 Aug 2007 17:0

Re: Parsing qmail-qread data

2007-09-02 Thread John W. Krahn
Chris E. Rempola wrote: John W. Krahn wrote: my ( $key, %data ); while ( <> ) { if ( /#.*\s(\S+)/ ) { $key = $1; } elsif ( /\sremote\s/ ) { $data{ $key }++; } } for my $key ( keys %data ) { print "'$key' sent $data{$key} emails.\n"; } John

Re: Parsing qmail-qread data

2007-09-02 Thread Rob Dixon
Chris E. Rempola wrote: I'm trying to parse qmail-qread data, but don't know how to find the number of occurrences after a particular string. Here is the data: +++ Beginning of data + 28 Aug 2007 17:00:47 GMT #8807850 41428 <[EMAIL PROTECTED]>

Re: Parsing qmail-qread data

2007-09-01 Thread Chas Owens
On 9/2/07, Chris E. Rempola <[EMAIL PROTECTED]> wrote: > Chas Owens wrote: > > > > The pattern /#.*\s(\S+)/ matches a literal # followed by anything up > > to a space and captures all contiguous non-space characters: > > > > "31 Aug 2007 04:00:22 GMT " prematch > > "#" matches # > > "8810118 3375

Re: Parsing qmail-qread data

2007-09-01 Thread Chris E. Rempola
Chas Owens wrote: The pattern /#.*\s(\S+)/ matches a literal # followed by anything up to a space and captures all contiguous non-space characters: "31 Aug 2007 04:00:22 GMT " prematch "#" matches # "8810118 337545 <[EMAIL PROTECTED]>" matches .* " " matches \s "bouncing" matches \S+ Even

Re: Parsing qmail-qread data

2007-09-01 Thread Chas Owens
On 9/1/07, Chris E. Rempola <[EMAIL PROTECTED]> wrote: snip > Can you explain the regex syntax of /#.*\s(\S+)/ > > How does that match the email address? The reason why I ask is because > I have one occurrence with the ouput of: > > OUTPUT + > 'bouncing' sent 402 emails. > /OUTPU

Re: Parsing qmail-qread data

2007-09-01 Thread Chris E. Rempola
John W. Krahn wrote: my ( $key, %data ); while ( <> ) { if ( /#.*\s(\S+)/ ) { $key = $1; } elsif ( /\sremote\s/ ) { $data{ $key }++; } } for my $key ( keys %data ) { print "'$key' sent $data{$key} emails.\n"; } John - Thanks so much! Exactl

Re: Parsing qmail-qread data

2007-08-31 Thread John W. Krahn
Ken Foskey wrote: On Fri, 2007-08-31 at 18:05 -0700, Chris E. Rempola wrote: I'm trying to parse qmail-qread data, but don't know how to find the number of occurrences after a particular string. Here is the data: +++ Beginning of data + 28 Aug 2

Re: Parsing qmail-qread data

2007-08-31 Thread John W. Krahn
Chris E. Rempola wrote: I'm trying to parse qmail-qread data, but don't know how to find the number of occurrences after a particular string. Here is the data: +++ Beginning of data + 28 Aug 2007 17:00:47 GMT #8807850 41428 <[EMAIL PROTECTED]>

Re: Parsing qmail-qread data

2007-08-31 Thread Ken Foskey
On Fri, 2007-08-31 at 18:05 -0700, Chris E. Rempola wrote: > I'm trying to parse qmail-qread data, but don't know how to find the > number of occurrences after a particular string. Here is the data: > > +++ Beginning of data + > 28 Aug 2007 17:00:4

Parsing qmail-qread data

2007-08-31 Thread Chris E. Rempola
I'm trying to parse qmail-qread data, but don't know how to find the number of occurrences after a particular string. Here is the data: +++ Beginning of data + 28 Aug 2007 17:00:47 GMT #8807850 41428 <[EMAIL PROTECTED]> done remote [EMAIL P