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.

In reply to Help with Spreadsheet::basicRead by innuendo98

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.