New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with ignore_last_delimiters #330
Comments
Looking at your input, it seems like a combinaison of const {parse} = require('csv/sync');
const input = `
Date, Type, Description, Value, Balance, Account Name, Account Number
11/02/2022,BAC,"'FOO",10.00,33432.80,"'REF","'123123-12312312",
`;
const output = parse(input, {
skip_empty_lines: true,
relax_column_count: true
}); |
Thanks, that's a better workaround as it avoids issue (3). |
Wait, I don't think this should be closed, it's just a workaround. As documented, |
I confirm that we don't handle yet quotes with
|
The confusion/complication here seems to be trying to use I would strongly suggest that this behaviour is moved to a separate option, or as a string option to
Additionally, I should point out that |
Thinking about this a bit further, I would suggest deprecating
|
Speaking about
|
No that's exactly what This option should never affect the parsing/escaping of quotes and it should never cause data to be ignored. It only affects how many empty string values are produced by trailing commas at the end of a row.
To be clear, this is what Example 1
Example 2 (any number of extra trailing delimiters are ignored)
Example 3 (ignore trailing delimiters in the column definition)
Example 4 (too many columns should still be an error)
Example 5 (keep trailing delimiters up to the expected number of columns)
Example 6 (too few columns should still be an error)
|
OK, this is much more clear. |
Describe the bug
ignore_last_delimiters: true
seems to have some issues:relax_quotes: true
then it fails withCsvError$1: Invalid Closing Quote: got "," at line 4 instead of delimiter, record delimiter, trimable character (if activated) or comment
trim: true
orrtrim: true
then it fails withCsvError$1: Invalid Closing Quote: found non trimable byte after quote at line 4
"'123123-12312312",
(the double quotes are part of the string)To Reproduce
Additional context
The text was updated successfully, but these errors were encountered: