in reply to Request for comments/ clues on simple text manipulation script

You're going to need to accumulate the lines so that you can print the summary before the details. Something like this (untested):
# Your count and letters declarations here my $accum; my $banner; while (<>) { if (/^L/i) { if ($banner) { print $banner, 'tstat propmean;elms=', @letters[0..$count- +1], "\n", $accum; } $banner = $_; $accum = ''; $count = 0; } elsif (/^N01/i) { s/\n/;ID=$letters[$count]\n/; ++$count; $accum .= $_; } else { $accum .= $_ } } print $banner, 'tstat propmean;elms=', @letters[0..$count-1], "\n", $a +ccum;

We're not really tightening our belts, it just feels that way because we're getting fatter.
  • Comment on Re: Request for comments/ clues on simple text manipulation script
  • Download Code