It's really just a matter of inverting the order of the indexes.
From an earlier thread (How to swap rows with columns?),
my @data; while (<>) { my @fields = split ' '; my $col = $. - 1; for my $row (0..$#fields) { $data[$row][$col] = $fields[$row]; } }
Tested.
In reply to Re: switch columns and rows
by ikegami
in thread switch columns and rows
by Not_yetta_Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |