I use the below code to read spread sheets. I am being inputed a line number that the header starts on. but I found that many of the input spreadsheets have a few to many blank rows lines starting at the top. there will be free form cells filled in but these are above the real header. So when I try to count the number rows down from top the count is off by the top blank rows and I donot know how to count them. example a spread sheet starts with 5 total blank rows and I am given 20 as the line # the real header start on... the real count i find to be 15 because the top 5 don't get seen in code below. Is there a answer to true row counting thanks David --------------------
use Spreadsheet::BasicRead; my $ss = new Spreadsheet::BasicRead($xlsFileName) || die "Could not o +pen '$xlsFileName': $!"; while (my $data = $ss->getNextRow()) { $row++; $d = "$row "; print join('|', $d, @$data), "\n"; }

In reply to reading xls by dwhalen1

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.