Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Text::CSV_XS -- Bug or wrong usage?

by diotalevi (Canon)
on Mar 27, 2003 at 17:43 UTC ( [id://246298]=note: print w/replies, xml ) Need Help??


in reply to Text::CSV_XS -- Bug or wrong usage?

In general Text::CSV_XS is buggy and I don't use it. Use Text::CSV instead - at least it works.

  • Comment on Re: Text::CSV_XS -- Bug or wrong usage?

Replies are listed 'Best First'.
Re: Re: Text::CSV_XS -- Bug or wrong usage?
by BrowserUk (Patriarch) on Mar 27, 2003 at 18:02 UTC

    Could you detail the other Text::CSV_XS bugs you know about please?

    I was just beginning to get comfortable with using this module rather than regexes for parsing CSV data given its superior performance over the modules available when I saw the OP's bug. It's a pain, but most of the stuff I am playing with doesn't use escapes never mind escaped escapes so I wasn't too bothered, but if there are more bugs, it would be nice to know what they are.

    It would also be useful to know if a) you have reported them to the author. b) what sort of response you recieved if any.


    Examine what is said, not who speaks.
    1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
    2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
    3) Any sufficiently advanced technology is indistinguishable from magic.
    Arthur C. Clarke.

      I tried Text::CSV_XS again and had zero problems. All I can figure is that maybe somewhere along the line it had something to do with seemingly escaped metacharacters. So things like "\\\t" (slash followed by a tab) might have confused it. I do recall that at the time, identical input was in some cases handled by Text::CSV and not handled by Text::CSV_XS though I can't seem to find what the failure mode is just now.

Re: Re: Text::CSV_XS -- Bug or wrong usage?
by Anonymous Monk on Mar 28, 2003 at 01:52 UTC
    For what definition of works? Text::CSV is unable to handle returns embedded in fields. See Text::xSV instead.

      My operational definition of works for CSV data has never had to include records with internal newlines. Also, a test on one batch of sample data just works now so either I was doing something incorrect in the past or this sample is somehow more correct than the previous samples. The second scenario is entirely possible since my current data only covers a few portions of Minneapolis while previous data has been constrained to Hennepin county (Minneapolis and some suburbs), just Minneapolis or all of Minnesota.

      So... Text::CSV_XS is working flawlessly right now for me though past experience has had me switch to the plain-perl Text::CSV.

      And as an additional plus, it was written by our missing monk. And I can state from personal experience using it, that it is a well put together module and that it works.

      TStanley
      --------
      It is God's job to forgive Osama Bin Laden. It is our job to arrange the meeting -- General Norman Schwartzkopf

Log In?
Username:
Password:

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

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

    No recent polls found