Im not really clear on a few things like value "1A" or "3A" go with type "MeasuemantA" ect ?use strict; #use warnings; turned off for redundant printf warning my @MeasurementType = sort qw(MeasurementA MeasurementB MeasurementC M +easurementB MeasurementB); my @MeasurementValue = sort qw(1A 3A 3A 2A 5A); my @MeasurementTry= sort qw(1 1 1 2 3); my @MeasurementTime= sort qw(DateA DateB DateC DateD DateE); my $size = @MeasurementTry - 1; print ("MeasurementType | MeasurementValue | MeasurementTry | Mea +surementTime\n"); print ("----------------|-----------------------|----------------|---- +------------\n"); for ( my $i = 0 ; $i <= $size ; $i++ ) { printf ("%-22s %-15s %-9s %-0s\n", ("$MeasurementType[$i]\t|", "$MeasurementValue[$i] \t|", "$MeasurementTry[$i]\t |", "$MeasurementTime[$i]")); }
Outputs:
EDIT: Updated code with some kind of formatting.MeasurementType | MeasurementValue | MeasurementTry | Measurement +Time ----------------|-----------------------|----------------|------------ +---- MeasurementA | 1A | 1 | DateA MeasurementB | 2A | 1 | DateB MeasurementB | 3A | 1 | DateC MeasurementB | 3A | 2 | DateD MeasurementC | 5A | 3 | DateE
In reply to Re: Sorting measurements
by james28909
in thread Sorting measurements
by Jenny1990
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |