Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: A module to parse CSVs line by line with an ability to set delimiter

by punch_card_don (Curate)
on Mar 26, 2013 at 15:06 UTC ( #1025541=note: print w/replies, xml ) Need Help??


in reply to A module to parse CSVs line by line with an ability to set delimiter

The DBI is your friend.

DBD::CSV

$dbh = DBI->connect (
"dbi:CSV:f_dir=$ENV{HOME}/csvdb;f_ext=.csv;f_lock=2;" .
"f_encoding=utf8;csv_eol=\n;csv_sep_char=\\;;"

"...Pay attention to the semi-colon for csv_sep_char (as seen in many CSV exports from MS Excel) is being escaped in below example, as is would otherwise be seen as attribute separator:..."




Time flies like an arrow. Fruit flies like a banana.
  • Comment on Re: A module to parse CSVs line by line with an ability to set delimiter

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025541]
help
Chatterbox?
[james28909]: how can i write a while loop on one line (in a script) something like print "this\n" && print "that" && <DATA> && print the other\n" && next if /this matches/ while <DATA>?
[james28909]: i have tried with && and and and have tried to rearrange the functions as well to no avail

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-05-20 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?