"Deneb Pettersson (LMF)" wrote:
> 
> Could you maybe send an example of your code, showing how you get 
> the data out, aswell as how you mark where to cut from the excel 

this code assumes you've already uploaded the .xls file to the server. 
for more information on all methods, try perldoc
Spreadsheet::ParseExcel.  btw, i typed this in without testing it, so
let me know if it doesn't work.

#!/usr/bin/perl -w
use strict;
use Spreadsheet::ParseExcel;

my $oExcel = new Spreadsheet::ParseExcel;
my $filename = '/path/to/excel/file/excelfile.xls';
my $oBook = $oExcel->Parse($filename);
print "total sheets: ", $oBook->{SheetCount}, "\n";

# execute for each sheet in the spreadsheet
for (my $i = 0; $i < $oBook->{SheetCount}; $i++) {

  # get a ref to a worksheet object
  my $oWks = $oBook->{Worksheet}[$i];

  # get the contents of a particular cell
  my $row = 1;
  my $col = 2;
  my $value = $oWks->{Cells}[$row][$col]->Value;

  # is there a value in this cell?
  (defined $value)
  ? (print "value for row $row column $col: $value\n")
  : (print "row $row column $col is empty\n");
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to