To take this a step further.

How would you go about creating a hash to sum up all the values in group $3
utilizing the flip/flop operator and print the results of the key and value
with the key being group $2?

Thank you,

Chris

while( <DATA> ) {
    if ( /0x3\|68\|/ .. /^#END/ ) {
        print if /\|68\|/;
        print join(",", $1, $2, $3 ), "\n" if /\|(\d)\|(\d+)\|(\d+)/;
    }
}

__DATA__
#LOGNUM|110|OPERATIONAL
|NETWORK.1:SUBNETWORK.100:EBSC.1:EBSCSHELF.4:DSFPVCARD.5
|6261.2.0.330.1.1|6261.2.0.330.1.1|0x3|68|1|1
|ACP2|12
|7|1|0
|7|2|2636
|7|3|0
|7|4|0
|7|5|2601
|7|6|0
|7|7|0
|7|8|0
|7|9|0
|7|10|0
|7|11|0
|7|12|0
#END


#LOGNUM|134|OPERATIONAL
|NETWORK.1:SUBNETWORK.100:EBSC.1:EBSCSHELF.4:DSFPVCARD.5
|6261.2.0.330.1.1|6261.2.0.330.1.1|0x3|68|1|1
|ACP5|12
|7|1|0
|7|2|2638
|7|3|0
|7|4|0
|7|5|2592
|7|6|0
|7|7|0
|7|8|0
|7|9|0
|7|10|0
|7|11|0
|7|12|0
#END


#LOGNUM|150|OPERATIONAL
|NETWORK.1:SUBNETWORK.100:EBSC.1:EBSCSHELF.4:DSFPVCARD.7
|6263.2.0.330.1.1|6263.2.0.330.1.1|0x3|68|1|1
|ACP1|12
|7|1|0
|7|2|2573
|7|3|0
|7|4|0
|7|5|2551
|7|6|0
|7|7|0
|7|8|0
|7|9|0
|7|10|0
|7|11|0
|7|12|0
#END

Reply via email to