-print STDERR "Sorting... ";
-$sortcol = @{$table[0]} - 1;
-$namecol = 1;
-@table = sort {
- my $p, $an, $bn;
- $p = $$b[$sortcol] <=> $$a[$sortcol];
- ($an = $$a[$namecol]) =~ s/(\S+)\s+(\S+)/$2 $1/;
- ($bn = $$b[$namecol]) =~ s/(\S+)\s+(\S+)/$2 $1/;
- $p ? $p : ($an cmp $bn);
-} @table;
-$i=0;
-while ($i < @table) {
- $j = $i;
- while ($i < @table && ${$table[$i]}[$sortcol] == ${$table[$j]}[$sortcol]) {
- $i++;
- }
- if ($i == $j+1) {
- ${table[$j]}[0] = "$i.";
- } else {
- ${table[$j]}[0] = $j+1 . '.' . $pos_delim . $i . ".";
- $j_old=$j;
- $j++;
- while ($j < $i) { ${table[$j++]}[0] = $j_old+1 . '.' . $pos_delim . $i . "."; };
- }
+print STDERR "Generating output... ";
+for my $u (sort keys %users) {
+ print join("\t", $u, $users{$u}, map { $tasks{$u}{$_} // '-' } @ARGV), "\n";