in reply to log file sorting

To keep the formatting in text output you might use a sub like this (untested):

sub rj { # right justifies each argument with a length of first parameter my $len= shift; my $str=''; while (@_) { $str.= substr(' 'x12 . shift @_), $len); } return $str; } print rj(12, @d); #prints data in columns of length 12
In a similar way it is possible to have a subroutine generate left shift or centered text.

Remember to divide a difficult problem into smaller steps. Solving these smaller steps is always easier than looking at the whole problem.

This is what I did because I have a heck of a problem understanding what you want to put where. I neither understand your sorting order ( #,B #/# #,E is alphabetically sorted??) nor where the 1 in A1 comes from.

Replies are listed 'Best First'.
Re^2: log file sorting
by numberninja (Initiate) on Aug 04, 2008 at 17:51 UTC
    well, my actual data labels aren't A, B, C, D, E, etc. They're vital signs, so they might start with those letters, I meant alphabetically sorted in that B comes before E. The 1 in A1 comes from the fact that there are multiple data points collect under the label "A", so each of those needs to have a sub label of A-1, A-2, etc
      Mea culpa, finally it dawned on me: I was reading A #,A #,B ... as A followed by #,A followed by #,B, i.e. I was taking the spaces as delimiters.

      Naturally it didn't make any sense to me ;-)