Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Comparison of the parsing features of CSV (and xSV) modules

by tilly (Archbishop)
on Jun 18, 2004 at 02:17 UTC ( [id://367837]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Comparison of the parsing features of CSV (and xSV) modules
in thread Comparison of the parsing features of CSV (and xSV) modules

The problem is not adding the features, it is figuring out the API for offering them, and seeing the need.

Which of the above user-defined features does DBD::AnyData need? All of them? Some? We probably should offline a discussion of how to provide them in a sane manner.

Some are already present in some form. For instance Text::xSV offers the ability to pre-filter input as it comes in. There is nothing to stop such a filter from saying, "These characters are not allowed." That won't work for eliminating embedded tabs in tab-delimited data. But it would for NUL characters. And if you want to disallow tabs embedded in a tab-delimited file, you could just wrap Text::xSV with the necessary validation logic.

Also as dragonchild points out, it reads based on $/ which can effectively allow you to change the record separator. Furthermore because I got tired of bug reports about invalid csv files, by default Text::xSV will treat either \n or \r\n as a newline, so files produced on Windows can be read on Unix and vice versa.

Some of the other missing features can't presently be worked around. For me the barrier isn't adding them if I thought people would use them, it is figuring out what a reasonable API should be.
  • Comment on Re^3: Comparison of the parsing features of CSV (and xSV) modules

Replies are listed 'Best First'.
Re^4: Comparison of the parsing features of CSV (and xSV) modules
by jZed (Prior) on Jun 18, 2004 at 02:53 UTC
    T> Which of the above user-defined features does DBD::AnyData need? All of them? Some? We probably should offline a discussion of how to provide them in a sane manner.

    JZ> I'll think it over and msg you. I'm not sure it's worth your trouble if you don't have other uses for them. As I said, the minuses in the chart don't necessarily indicate a lack. Your module covers most of the formats people need, the other modules fill in the gaps for some odd formats that cover the edge cases.

    T> Some are already present in some form.

    JZ> I'll take a closer look and revise the chart.

    T> because I got tired of bug reports about invalid csv files, by default Text::xSV will treat either \n or \r\n as a newline, so files produced on Windows can be read on Unix and vice versa.

    JZ> I hear you. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-20 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found