(Reply to the revised node — people, don't do that, don't delete the original contents. This is more some temporary medium for communication, solving your technical problems; this is supposed to be an archive, too. Editing nodes this way destroys their value. Anyway, beck to your regular programme.)
If your data comes from Excel, you shouldn't worry about it not including empty cells to the left of any nonempty cells. So all you'd still have to do is make sure @data holds the same number of columns as the header array does. The easiest to achieve that is:
$#data = $#table;
If this creates extra columns, they'll be undef. Any undefined values in the data will be replaced with NULL in the database, by DBI.
If, however, people have put data in the wrong cells, all bets are off.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.