Step 1: Whatever computer you are using to post questions here, have Perl and Text::CSV (and Text::CSV_XS) installed there, and either copy or create a suitable quantity of relevant CSV data on that computer.

Step 2: Write a Perl script (on that computer) to read all the csv data, using the same approach you intend to use on your "work laptop"; this script should print out a simple summary report: how many files were opened for reading, and how many rows of data were read (in total, and/or per csv file).

Step 3: If this test script (written and run on the computer that you use to post questions on PM) does not report the expected quantities, or doesn't run at all, and you can't figure out why, copy/paste that script, along with its output, including error messages/warnings, all within code tags when you post your next question here.

Step 4: Once you confirm that your test code reads all your test csv data correctly, run that exact same code on your "work laptop", and see whether it reports correct numbers for the actual (production) csv data that you need to load into your database. If it doesn't, you need to figure out how your test data differs from the production data, and adjust your code accordingly. If necessary, add to the test data on your testing/posting machine to replicate the problem, so you can copy/paste the records that cause the trouble.

Step 5: Once you confirm that your test code reads all your production data correctly, make a copy of it and use the copy to add the Oracle DB stuff. I would recommend using DBI if possible (this will automatically invoke DBD::Oracle for the connection); that way, you would be able to put some other database handler on your testing/posting machine - e.g. SQLite or MySQL - in order to perform the same DB operations without having to run your own separate Oracle server. (There could be differences between Oracle and other DBs that might cause problems for you, but at least you'd be able to isolate problems of this sort with some confidence.)

Maybe that sounds like a lot of work, but from what I can see, if you don't do that, you'll never finish the job.


In reply to Re: Perl csv insert with special character by graff
in thread Perl csv insert with special character by homer4all

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.