Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
go ahead... be a heretic
 
PerlMonks  

Re: TEXT::CSV Error 2032

by Happy-the-monk (Monsignor)
on Jun 25, 2012 at 16:13 UTC ( #978220=note: print w/ replies, xml ) Need Help??


in reply to TEXT::CSV Error 2032

CSV_XS ERROR: 2023 EIF - CR char inside unquoted

Not knowing the Text::CSV module at all, I read the error message like this:

"There is a CR - carriage return inside of your CSV data, but it is not at the end-of-line."

I understand: the operating system where you are getting this message is not using carriage return+line feed as the end-of-line marker, but maybe just the line feed.

This may seem strange, but maybe it is all there is to it.

Have you tried dos2unix or something similar on your data or would that break it?

If it doesn't succeed, the CR might be somewhere inside the data, not anywhere close to the end-of-line."

Cheers, Sören


Comment on Re: TEXT::CSV Error 2032
Re^2: TEXT::CSV Error 2032
by Tux (Monsignor) on Jun 25, 2012 at 16:46 UTC

    Completely wrong. All of it. Text::CSV_XS automatically deals with CR and/or NL in CSV streams/files.

    When in doubt, read the manpage:

    2023 "EIQ - QUO character not allowed" Sequences like "foo "bar" baz",quux and 2023,",2008-04-05,"Foo, Bar",\ +n will cause this error.

    update: Sorry for that tone. I got sidetracked by the wrong paste in the OT. He used a message-code mismatch. I look at codes

    2032 "EIF - CR char inside unquoted, not part of EOL"

    2032 != 2023. Most of the time, NOT passing eol to the constructor is likely to solve the issue


    Enjoy, Have FUN! H.Merijn

        The OP did add binary => 1 in the constructor, so that part of the doc is not applicable to this problem IMHO.

        Again sorry for the harsh tone in my first reply. Appreciate your help to people with questions.


        Enjoy, Have FUN! H.Merijn
        Hello Monks, the chomp was not the problem :-(. I also tried to substitute the newlines. Very strange.
        False alarm . I have found the problem. Now it works. There were hidden ^M chars in the file. For other user, got this problem. With substitute s/^M//g I solved the error. Thanks Tux for the right direction.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-04-19 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls