use Spreadsheet::XLSX;
my $excel = Spreadsheet::XLSX->new("Emp.xlsx");
my $sheet = ${$excel->{Worksheet}}[0];
my ($row_min, $row_max) = $sheet->row_range();
my ($col_min, $col_max) = $sheet->col_range();
open (FH,">", "Emp.csv") or die "$!";
for my $row ($row_min..$row_max)
{
print FH join (",", map {$sheet->get_cell($row,$_)->value()} ($col_min..$col_max));
print FH "\n";
}
close (FH);
my $excel = Spreadsheet::XLSX->new("Emp.xlsx");
my $sheet = ${$excel->{Worksheet}}[0];
my ($row_min, $row_max) = $sheet->row_range();
my ($col_min, $col_max) = $sheet->col_range();
open (FH,">", "Emp.csv") or die "$!";
for my $row ($row_min..$row_max)
{
print FH join (",", map {$sheet->get_cell($row,$_)->value()} ($col_min..$col_max));
print FH "\n";
}
close (FH);
1 comment :
How can I do this for multiple worksheets ?
Post a Comment