Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Which CSV - Module is my favourite?

by Ben Win Lue (Friar)
on Jan 18, 2006 at 08:43 UTC ( #523934=perlquestion: print w/ replies, xml ) Need Help??
Ben Win Lue has asked for the wisdom of the Perl Monks concerning the following question:

Hi everbody out there!

I have to parse some simple CSV-Files. Text::CSV seems to be my friend, except that here in Germany most CSV-Files are separated by semicolons, since a comma is the standard decimal point here. ( I don't know if this was a microsoft idea, but it became more and more normal in the past 10 years).

Is there a way to set the separator character in Text::CSV?

If not, what else would be worth a look?

The files are quite simple, may be should just use  split and get rid of the leading and trailing quotes?

Thanks a lot!

Comment on Which CSV - Module is my favourite?
Download Code
Re: Which CSV - Module is my favourite?
by blazar (Canon) on Jan 18, 2006 at 08:51 UTC
    I used Text::CSV_XS and it definitely supports alternative filed separators. I recommend it over Text::CSV in any case because it is a fast C reimplementation of the latter.
Re: Which CSV - Module is my favourite?
by dragonchild (Archbishop) on Jan 18, 2006 at 14:51 UTC
    Text::xSV is your friend. It is a superset of the features in Text::CSV_XS, yet is pureperl and almost as fast. And, it is a lot more robust (in my opinion) with a much clearer API.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://523934]
Approved by jbrugger
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2015-07-01 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (17 votes), past polls