NothingInCommon has asked for the wisdom of the Perl Monks concerning the following question:

**retracted**

Replies are listed 'Best First'.
Re: Almost there..please help this noob.
by bichonfrise74 (Vicar) on Jun 20, 2009 at 17:06 UTC
    See if this helps with regards to the parsing of the new input.
    #!/usr/bin/perl use strict; my (%id, $count); while (<DATA>) { $count++ if /^BS/; $id{$count} = $1 if /^BS:\s(\w+)/; my @cols = $_ =~ /(\w+)\s\((\d+?%)\s\/\s(\d+?)/; print "$id{$count} ", join "\t", @cols , "\n" if !/^BS/; } __DATA__ BS: 111_DDD, QE: QE_AAA AAA_AA1_DDD (0% / 0 of 1024 | event 0% / 0 of 1024) AAA_AA2_DDD (0% / 0 of 1024 | event 0% / 0 of 1024) BS: 222_DDD, QE: QE_AAA BBB_BB1_DDD (0% / 0 of 1024 | event 0% / 0 of 1024) BBB_BB2_DDD (0% / 0 of 1024 | event 0% / 0 of 1024) BS: 333_DDD, QE: QE_AAA CCC_CC1_DDD (0% / 0 of 1024 | event 0% / 0 of 1024) CCC_CC2_DDD (0% / 0 of 1024 | event 0% / 0 of 1024)
Re: Almost there..please help this noob.
by dsheroh (Monsignor) on Jun 21, 2009 at 11:59 UTC
    Please don't delete your questions after you find an answer. Someone else may have the same question in the future and this denies them the opportunity to look up the answer by way of your asking.