in reply to Re: Transpose of an array
in thread Transpose of an array

Hi,

Thanks for the code. It worked. In fact, yesterday, I wrote a similar type of code (which worked fine-pasted below). But, I was trying to get it done through two dimensional arrays.

my $tfields; while (my $row=$csv->getline($FILE1)) { for (my $i = 0; $i < @$row; $i++){ push (@{$tfields -> [$i]}, $row ->[$i]); } } foreach my $row (@$tfields) { $csv->print ($FILE2, $row); }

Replies are listed 'Best First'.
Re^3: Transpose of an array
by ikegami (Patriarch) on Oct 13, 2011 at 20:27 UTC
    huh? It does build a 2d array.