jsuresh has asked for the wisdom of the Perl Monks concerning the following question:
Thanks,
use Spreadsheet::XLSX; my $excel = Spreadsheet::XLSX -> new ('/tmp/temp.xlsx'); print $excel; my @array; my $workbook = Excel::Writer::XLSX->new( 'perl.xlsx' ); #my $FILENAME="/tmp/Newfile.xls"; my $workbook = Spreadsheet::WriteExcel->new("$FILENAME"); my $worksheet1=$workbook->addworksheet("Worksheet1"); $worksheet1->write( "A1", "Hi Excel!" ); foreach my $sheet (@{$excel -> {Worksheet}}) { printf("Sheet: %s\n", $sheet->{Name}); $sheet -> {MaxRow} ||= $sheet -> {MinRow}; foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { $sheet -> {MaxCol} ||= $sheet -> {MinCol}; foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxC +ol}) { my $cell = $sheet -> {Cells} [$row] [$col]; if ($cell) { printf("( %s , %s ) => %s\n", $row, $col, $ +cell -> {Val}); my $temp=$cell->{Val}; $worksheet1->write($row,$col,$cell -> {Val} +); # push(@array,$temp); # $sheet->write($row,$col,"CHECK"); } } } last
2019-03-30 Athanasius removed paragraph tags from code and added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading and printing an XLSX file
by Athanasius (Archbishop) on Mar 21, 2019 at 07:59 UTC | |
|
Re: Reading and printing an XLSX file
by Tux (Canon) on Mar 21, 2019 at 09:02 UTC | |
by jsuresh (Acolyte) on Mar 21, 2019 at 10:54 UTC | |
by Tux (Canon) on Mar 21, 2019 at 11:09 UTC | |
by marto (Cardinal) on Mar 21, 2019 at 11:02 UTC |