in reply to Re: Create CSV file from xlsx file
in thread Create CSV file from xlsx file
Error: syntax error at test.pl line 20,near "$sheet1{" syntax error at test.pl line 50,near "$sheet1}" aborted due to compilation error
use Spreadsheet::XLSX; use Spreadsheet::Read; my $excel = Spreadsheet::XLSX -> new ('Sample.xlsx',); #print "$excel \n"; my @sheets = qw(Sheet1 Sheet2); my $sheet1 = $sheet[0]; my $sheet2 = $sheet[1]; foreach my $sheet1{ my $sheet=$excel -> Worksheet(); printf("Sheet: %s\n", $sheet); my $maxrow = $sheet -> {MaxRow}; my $Minrow = "3"; $maxroww ||= $Minrow; foreach my $row ( $Minrow .. $maxrow) { $sheet -> {MaxCol} ||= $sheet -> {MinCol}; my @wanted_cols = (9, 10, 11, 21); my @wanted_cells = @{$sheet->{Cells}[$row]}[@wanted_co +ls]; if ($wanted_cells) { printf("( %s , %s ) => %s\n", $row, $col, +$cell -> {Val}); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Create CSV file from xlsx file
by kcott (Archbishop) on Oct 25, 2013 at 07:41 UTC | |
by viji234 (Initiate) on Oct 28, 2013 at 08:25 UTC | |
by Tux (Canon) on Oct 28, 2013 at 09:17 UTC | |
by viji234 (Initiate) on Oct 28, 2013 at 10:48 UTC | |
by Tux (Canon) on Oct 28, 2013 at 12:07 UTC | |
|