Title: RE: Excel

Thank you

-----Original Message-----
From: Thomas_M [mailto:[EMAIL PROTECTED]]
Sent: 27 January 2003 05:53
To: 'Mundell, R. (Ronald)'; Perl-Unix-Users (E-mail); Perl-Win32-Users
(E-mail)
Subject: RE: Excel


> How do one determine the amount of lines within a spreadsheet
> Ronald

Since you posted in both the unix and win32 lists, I assume you'd like a
cross-platform answer. Here's one:

    use Spreadsheet::ParseExcel;
    my $oBook = Spreadsheet::ParseExcel::Workbook->Parse('spreadsheet.xls');
    my $rowCount;
    foreach my $oWkS (@{$oBook->{Worksheet}}) {
        $rowCount += $oWkS->{MaxRow};
    }
    print "Rows= ", $rowCount;

Here's another:

  use Spreadsheet::ParseExcel::Simple;
  my $xls = Spreadsheet::ParseExcel::Simple->read('spreadsheet.xls');
  foreach my $sheet ($xls->sheets) {
     while ($sheet->has_data) { 
         my @data = "">
     }
  }
  print "Rows= ", scalar @data;


--
Mark Thomas                    [EMAIL PROTECTED]
Internet Systems Architect     User Technology Associates, Inc.

$_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;;
 

Reply via email to