Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Perl DBI for MariaDB v SQLite in a Single Use SBC

by afoken (Chancellor)
on Mar 21, 2023 at 13:02 UTC ( [id://11151099]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Perl DBI for MariaDB v SQLite in a Single Use SBC
in thread Perl DBI for MariaDB v SQLite in a Single Use SBC

When it comes to handling CSV, the usual hint is to use Text::CSV (and Text::CSV_XS). For the data shown, readline and substr should be sufficient. When the data becomes slightly more complex, Text::CSV is the way to go, because it can handle the crazy edge cases you never even thought of.

Having said that, there is also DBD::CSV, sitting on top of Text::CSV_XS and providing access to CSV files as if they were any other ordinary SQL database. And at that point, you no longer have to think about the CSV files at all. Just SELECT from the CSV files using one database handle connected to the CSV files "database", and INSERT/UPDATE to SQLite (or any other database) using a second database handle connected to SQLite (or any other database).

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found