in reply to Win32::OLE excel
(untested)use Spreadsheet::ParseExcel::Simple; use strict; my $file = shift; my $rows = 0; my $cols = 0; my $xls = Spreadsheet::ParseExcel::Simple->read($file); my @sheets = $xls->sheets; while ($sheets[0]->has_data) { $rows++; my @data = $sheets[0]->next_row; if (@data > $cols) { $cols = @data; } } print "Rows: " . $rows, "\n"; print "Cols: " . $cols, "\n";
|
|---|