use strict; use warnings; use Math::Matrix qw(transpose); use Spreadsheet::ParseExcel::Simple; use Spreadsheet::WriteExcel::Simple; my $xls = Spreadsheet::ParseExcel::Simple->read('old.xls'); my @data; for ($xls->sheets) { while ($_->has_data) { push @data, [$_->next_row]; } } my $matrix = Math::Matrix->new(@data); my $ss = Spreadsheet::WriteExcel::Simple->new; $ss->write_row($_) for @{$matrix->transpose}; open OUT,'>','new.xls'; binmode OUT; print OUT $ss->data;
UPDATE: thanks gmax! :)
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Transpose Excel Data
by gmax (Abbot) on Dec 10, 2003 at 18:11 UTC | |
|
Re: Transpose Excel Data
by zentara (Cardinal) on Dec 10, 2003 at 15:47 UTC | |
|
Re: Transpose Excel Data
by ambrus (Abbot) on Dec 16, 2003 at 09:08 UTC |