Comments (6)
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.
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.
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.
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.
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.
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)
- csv() cannot have both in and out be filenames HOT 3
- Wishlist: ability to throw exception if formula seen in CSV HOT 8
- _is_arrayref, _is_hashref and _is_coderef is incorrectly defined HOT 9
- Add an option to the csv function to neither return nor print anything HOT 3
- Add support for configurable NULL encoding HOT 7
- csv2xls does not like (nearly) empty files HOT 3
- Calling $csv->header breaks auto_diag in 1.40 HOT 8
- csv munge_column_names function fails with sep=; header HOT 1
- getter quote_char() and escape_char() returning 0 instead of undef HOT 5
- Can't parse fields with nested quotes and commas HOT 2
- Offer option to not put empty columns into hashes created HOT 1
- Procedure (or method) returning the error text HOT 2
- csv in => $aoa, out => … produces a CSV file with two empty records when $aoa is empty HOT 2
- Turn off column naming munging HOT 2
- Multiple spaces as a separator? HOT 3
- Typo in sub csv() causes sep chars set to not work HOT 2
- getline_all does not understand scientific ("e") notation HOT 2
- BOM without a header line. HOT 6
- POD: Decide if it is $fh or $io HOT 1
- skip empty or blank HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from text-csv_xs.