Excel spreadsheet to delimited text
use Spreadsheet::ParseExcel;
my $file = shift || die "Give me an Excel file!\n";
-e $file and -r _ or
die "Must provide valid Excel file! $file, $!\n";
my $excel_obj = Spreadsheet::ParseExcel->new();
my $workbook = $excel_obj->Parse($file);
die "Workbook did not return worksheets!\n"
unless ref $workbook->{Worksheet} eq 'ARRAY';
for my $worksheet ( @{$workbook->{Worksheet}} ) {
for my $row ( 0 .. $worksheet->{MaxRow} ) {
for my $col ( 0 .. $worksheet->{MaxCol} ) {
my $cell = $worksheet->{Cells}[$row][$col];
print ref $cell ? $cell->Value : '';
print "\t" unless $col == $worksheet->{MaxCol};
}
print "\n";
}
print "\n";
}