open( FILE, '<', $sumOutPath ) or warn "!!! Cannot Open $sumOutPath !!!\n"; @LINES = (); @LINES = ; my @LINES2 = @LINES; close FILE; # For each row we may need to foreach my $LINE (@LINES) { chomp $LINE; if (index($LINE, $rpcComboStatsSegments[0]) != -1) { ### This row needs to be fixed to by a loop for all Stats if the first or 2nd isn't found. if($debug) { print "--->>> $LINE contains $rpcComboStatsSegments[0]\n"; } $combinedTotal = (split /,/,$LINE)[1]; if($debug) { print "Combined Total = $combinedTotal\n"; } foreach my $LINE2 (@LINES2) { chomp $LINE2; if($debug) { print "---->>>> full line $LINE2 and $rpcComboStatsSegments[1]\n"; } if (index($LINE2, $rpcComboStatsSegments[1]) != -1) { if($debug) { print "---->>>> $LINE2 contains $rpcComboStatsSegments[1]\n"; } $combinedTotal = $combinedTotal+(split /,/,$LINE2)[1]; #print "Combined Total now = $combinedTotal\n"; #we want to Append a Total RPC statistic to the end of the SummaryOut file open( FILE, '>>', $sumOutPath ) or warn "!!! Cannot Open $sumOutPath !!!\n"; print FILE $rpcComboStatsSegments[2] . "," . $combinedTotal . "\n"; close FILE; last; } } } }