col_names skip_first_row By default DBD::CSV assumes that column names are stored in + the first row of the CSV file and sanitizes them (see "raw_head +er" below). If this is not the case, you can supply an array re +f of table names with the col_names attribute. In that case the attribute skip_first_row will be set to FALSE. If you supply an empty array ref, the driver will read the +first row for you, count the number of columns and create column +names like "col0", "col1", ... Note that column names that match reserved SQL words will c +ause unwanted and sometimes confusing errors. If your CSV has he +aders that match reserved words, you will require these two attri +butes. ... raw_header Due to the SQL standard, field names cannot contain special characters like a dot (".") or a space (" ") unless the col +umn names are quoted. Following the approach of mdb_tools, all + these tokens are translated to an underscore ("_") when reading t +he first line of the CSV file, so all field names are 'sanitized'. I +f you do not want this to happen, set "raw_header" to a true value a +nd the entries in the first line of the CSV data will be used verb +atim for column headers and field names. DBD::CSV cannot guarantee +that any part in the toolchain will work if field names have those characters, and the chances are high that the SQL statement +s will fail.

I'll think of a more clear way to document what this sanatation actually means.


Enjoy, Have FUN! H.Merijn

In reply to Re^2: DBD::CSV works with text, but not numbers by Tux
in thread dbi::CSV works with text, but not numbers by Sandy_Bio_Perl

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.