reaper9187 has asked for the wisdom of the Perl Monks concerning the following question:
As you can see, the merged array is 'misalinged' in the excel worksheet. I would like to preserve the order of arrays while printing. Also, I need to merge several ( read 5 to 6) such 2D arrays. Is there a succint way to achieve this ? Thanks for the help in advance !!use strict; use Spreadsheet::WriteExcel; use Data::Dumper; my $workbook = Spreadsheet::WriteExcel->new("write_arrays.xls"); my $worksheet1 = $workbook->add_worksheet('Example 1'); my @arr = ( [ 'A' , 1, 0, 5, 6 ], [ 'B' , 3 , 4 , 5 , 6 ], [ 'C' , 2 , 4 ,3 ,5 ], [ 'D' , 6 , 7 , 8 ,8 ] ); my @arr1 = ( [ 'E' , 8 , 8 , 8 , 5 ], [ 'F' , 4 , 3 , 2 ,2 ], [ 'G' , 1 , 8 , 8, 8 ], [ 'H' , 1 , 4 , 5, 6 ] ); my @new; push(@arr, [@arr1]); $worksheet1->write_col('A3', \@arr);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to merge/join two multidimensional(2D) arrays
by AppleFritter (Vicar) on Jul 04, 2014 at 16:09 UTC | |
|
Re: How to merge/join two multidimensional(2D) arrays
by davido (Cardinal) on Jul 04, 2014 at 18:00 UTC | |
|
Re: How to merge/join two multidimensional(2D) arrays
by ww (Archbishop) on Jul 04, 2014 at 17:46 UTC |