Hello From California!
Keary Suska
aksuska at webflyer.com
Tue Sep 18 20:50:06 CDT 2001
Pretty straightforward, if the whole output is as consistent as the sample.
while( <> ) {
next if /^$/; # skipping blank lines
if( m|^Change \d+ on [0-9/]+ by| ) {
$change = $_; # cache line
next; # skip to next line
}
elsif( @bugs = /BUG(\d{5})/g ) {
foreach $bug ( @bugs ) {
$entry{$bug} = $change;
}
}
}
This code assumes that you may have one change apply to multiple bugs, but
not visa versa. You would need a more complicated data structure for that.
Once you have the data, you can do whatever you want with it.
Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"
> From: Adrian Kalaveshi <akalaveshi at mahinetworks.com>
> Date: Tue, 18 Sep 2001 18:30:02 -0700
> To: "'pikes-peak-pm-list at hfb.pm.org'" <pikes-peak-pm-list at happyfunball.pm.org>
> Subject: Hello From California!
>
> Hello all...
>
> I've settled in and started to work. I'm not sure that I'm still privy to
> your help, but I thought someone might shed some light on a problem I've
> encountered. I'm parsing out a stream of text that looks something like:
>
>
> Change 28637 on 2001/09/13 by jjonnala at jj_client_bgp1
>
> BUG04155 and BUG04018 fixes - debug and sock reuse port option on no
> router bgp
>
> Change 28245 on 2001/09/11 by jjonnala at jj_client_bgp1
>
> BUG03882 - update debugs - damping debugs
>
>
> I need to sort this output by bug number -- so that change 28637 appears in
> both the BUG04155 and BUG04018 buckets but change 28245 only appears in the
> BUG03882 bucket. The BUG\d\d\d\d text can appear anywhere in the
> description. I have no clue where to start on this seemingly easy script.
> Any help would be appreciated...
>
> From where the palm trees sway,
> -adrian-
>
More information about the Pikes-peak-pm
mailing list