Hi everyone,
I have a problem with some code tweeking.
The problem I have is that the columns are all messed up.
This is output I have
02:17 02:40 02:46 02:59 Apples 0 0 0 0 Grapes 7 7 7 7 bricks 0 0 0 0 TUBELIGHS 282 271 265 257 TOTAL 334 320 312 303
This is the part of the code I am using:
printf "%${lenght_frt}s ", " "; foreach (sort keys %date) { printf "%-${lenght_date}s ", $_; } print "\n"; foreach (sort keys %obj) { printf "%-${lenght_frt}s ", $_; for( my $i = 0; $i <= $#date; $i++) { if(exists($count{$_}->{$date[$i]})) { print " " x ($lenght_date), $count{$_}->{$date[$i]}; } } print "\n"; } close (FH); print "\n"; printf "%-${lenght_frt}s ", " TOTAL "; print map { sprintf "%7d", $_ }@tasks; print "\n"; }
How can I correct the code so that my output is clean like:
02:17 02:40 02:46 02:59 Apples 0 0 0 0 Grapes 7 7 7 7 bricks 0 0 0 0 TUBELIGHS 282 271 265 257 TOTAL 334 320 312 303
GREATEFULLY
Code tags and formatting added by GrandFather
In reply to arrange columns by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |