Try this
my $oExcel = new Spreadsheet::ParseExcel;

die "You must provide a filename to $0 to be parsed as an Excel file" unless
@ARGV;
$filename = $ARGV[0];
 if(!-e $filename){
     $log_data .= $filename." ==> The File Does not exist at that
location\n";
     &file_write($log_file,$log_data);
     exit();
 }
my $oBook = $oExcel->Parse($ARGV[0]);
my($iR, $iC, $oWkS, $oWkC);


for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++)
{
 $oWkS = $oBook->{Worksheet}[$iSheet];

 for(my $iR = $oWkS->{MinRow} ;
     defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ;
     $iR++)
 {
  for(my $iC = $oWkS->{MinCol} ;
      defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ;
      $iC++)
  {
   $oWkC = $oWkS->{Cells}[$iR][$iC];

}
}
}
Chaitanya




On Thu, Nov 11, 2010 at 8:39 PM, Anush <anushajl...@gmail.com> wrote:

> Is there any code for reading an xls file in perl.
> I found the following code from net, but it does not work. Please help
> me.
>
>
> #!/usr/bin/perl -w
>
> use strict;
> use Spreadsheet::Read;
> use Data::Dumper;
>
> my $xls = ReadData ("Input/sample.xls");
>
> print $xls->[1]{'A1'};
> exit;
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>

Reply via email to