Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Best method to load a csv file.

by CountZero (Bishop)
on Dec 17, 2004 at 23:56 UTC ( [id://415807]=note: print w/replies, xml ) Need Help??


in reply to Best method to load a csv file.

I had a similar problem: differently formatted CSV-files to be unified and entered into one DB.

Best approach (for me) was to write a script for each type of CSV-file (using Text::CSV_XS) and dumping the data from these CSV-files into a temporary table (either through a loader or with DBI and then finally transfer the data from the temporary table to the main DB (again with DBI.

A dedicated loader is indeed faster than DBI, but if you take into account the time to write out the "unified" CSV-file as well, I'm not so sure that you win much time in the end.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://415807]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found