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

Re: TEXT::CSV Error 2032

by Happy-the-monk (Abbot)
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

Replies are listed 'Best First'.
Re^2: TEXT::CSV Error 2032
by Tux (Abbot) 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
        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.
        Hello Monks, the chomp was not the problem :-(. I also tried to substitute the newlines. Very strange.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978220]
and the monks are mute...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-11-20 02:26 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (283 votes). Check out past polls.