innuendo98 has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks, Here's the problem I'm trying to read from a spreadsheet, the last sheet, and up to that point there's no problem... that is until I run it, for some reason inside of the while loop nothing happens. I've tested the same code on some other file and seems to be working fine. Does anyone know if the basicRead has any issues with merged cells or something like that ? Thanks before hand, H
#!/usr/bin/perl -w use Spreadsheet::BasicRead; if (!defined($ARGV[0]) or !defined($ARGV[1])) { die "\n\n** ** W A R N I N G ** **\nUSE: aes_rateport_pars +e.pl INFILEPATH OUTFILEPATH \n\n"; } #delimiter: my $delim = "\ "; my $in_file = $ARGV[0]; my $out_file = $ARGV[1]; my $line; open (OUTFILEHANDLE, ">$out_file") or die "Could not open '$out_file': + $!"; my $ss = new Spreadsheet::BasicRead($in_file) or die "Could not open ' +$in_file': $!"; my $maxSheet = $ss->numSheets(); $ss->setCurrentSheetNum($maxSheet-1); #$ss->setHeadingRow(6); #$ss->skipHeadings(6); $ss->setRow(7); print $ss->currentSheetName() . " <- Sheet Name\n"; print $ss->getRowNumber() . " <- Row Number\n"; #print $ss->cellValue(8, 12) . " <- Cell value doesn't return anythin +g !!! \n"; my $row = 0; while (my $data = $ss->getNextRow()) { next if ( @$data[2] eq ""); $row++; print join('|', $row, @$data), "\n"; } close(OUTFILEHANDLE);
If you want to see the file I'm working on send me your email if you want to try it out... nothing in the file seems to be out of the ordinary for the script not being able to read it.

Replies are listed 'Best First'.
Re: Help with Spreadsheet::basicRead
by sub_chick (Hermit) on Jun 20, 2008 at 03:45 UTC
    You may want to check out Spreadsheet::ParseExcel if you have yet to do so.


    Es gibt mehr im Leben als Bücher, weißt du. Aber nicht viel mehr. - (Die Smiths)"