GithubHelp home page GithubHelp logo

Comments (6)

Tux avatar Tux commented on August 15, 2024

adding auto_diag => 1 to the attributes:

# CSV_XS ERROR: 2023 - EIQ - QUO character not allowed @ rec 2 pos 71 field 18
not ok 1 - processed expected number of lines
#   Failed test 'processed expected number of lines'
#   at sandbox/issue3.pl line 22.
#          got: '1'
#     expected: '3'
1..1
# Looks like you failed 1 test of 1.

Text::CSV (hence Text::CSV_PP) is supposed to follow Text::CSV_XS, but the author has stopped following closely. I don't know why.

The problem seems to be

M|"""The ", K
         ^

Where that " is interpreted as the closing quote.
Investigating …

from text-csv_xs.

leejo avatar leejo commented on August 15, 2024

Text::CSV (hence Text::CSV_PP) is supposed to follow Text::CSV_XS, but the author has stopped following closely. I don't know why.

Ah, unfortunately makamaka's modules are falling into disrepair. Whether or not makamaka is still involved with perl, or simply doesn't have time to maintain the modules i don't know. I have offered to take over maintenance of the modules but to no avail. I will bug makamaka again.

from text-csv_xs.

Tux avatar Tux commented on August 15, 2024

On second thought: the error is correct

|"""The ", K, |
 123    4

Quote 1 is the quotation: the introduction to a quoted field
Quote 2 is an escape to Quote 3
Quote 3 is escaped by Quote 2
Quote 4 is a loose quote, allowed by allow_loose_quotes (it is not a loose escape, as the , does not need to be escaped as it has no special meaning)

Then follows some text and a |. As the pipe is the separator and there is no finishing quote before the |, this field is not terminated and hence causes an error.

Does that explain enough?

2|||||||195658|"""The Cottage"" 54"|"""The "|K|||||307652|R, M|"""The ", K, |EA MATCH
⇓
2|||||||195658|"""The Cottage"" 54"|"""The "|K|||||307652|R, M|"""The ", K, "|EA MATCH

and to make that valid, it should be allow_loose_escapes => 1 instead of allow_loose_quotes => 1.

from text-csv_xs.

leejo avatar leejo commented on August 15, 2024

Does that explain enough?

It does. We know the data we have is crap, so the bug seems to be Text::CSV_PP being a little more tolerant of crap data, and not with Text::CSV_XS.

Thanks for the info.

from text-csv_xs.

Tux avatar Tux commented on August 15, 2024

If you are to take over Text::CSV (or become co-maint), I am more than happy to help out with questions like these.
Note that the current temptation in getting Text::CSV_PP up-to-date with Text::CSV_XS is the relative new functionality of the csv () function, which integrated rather heavily into the XS code.

from text-csv_xs.

leejo avatar leejo commented on August 15, 2024

OK. I've bugged makamaka again. Let's see what the response is. I guess we can close this. Thanks!

from text-csv_xs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.