You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example was reduced from a real CSV file, which had several fields, complete with inlined double-quotes, commas, and other potential hazards (I can't share the original file due to PII). Numbers and a few other programs parsed it correctly. zq parses it correctly, once I add a newline on the very last line of the file.
I can reproduce the same behavior with this:
# Unquoted simple strings, plus final newline (due to default `echo` behavior) - works fine
❯ echo "foo,bar\nfoo,bar" | zq -i csv -z 'yield this' -
{foo:"foo",bar:"bar"}
# Quoted string values, plus final newline - still works fine
❯ echo "foo,bar\n\"foo\",\"bar\"" | zq -i csv -z 'yield this' -
{foo:"foo",bar:"bar"}
# Quoted string values, but without a newline ending the contents (changed to `echo -n`), I receive this error message.
❯ echo -n "foo,bar\n\"foo\",\"bar\"" | zq -i csv -z 'yield this' -
stdio:stdin: parse error on line 2, column 10: bare " in non-quoted-field
# Removing the quotes from the values, still with no final newline (`echo -n`), works again.
❯ echo -n "foo,bar\nfoo,bar" | zq -i csv -z 'yield this' -
{foo:"foo",bar:"bar"}
❯ zq -version
Version: v1.16.0
The text was updated successfully, but these errors were encountered:
Thanks @chrismo. It turns out this was already a known bug #4732 so I'm going to close this one as a duplicate and you can feel free to "Subscribe" to that one so you'll be notified when we fix it. It helps to have your report though because when we know community users keep bumping into these we need to boost the priority on getting them fixed.
This example was reduced from a real CSV file, which had several fields, complete with inlined double-quotes, commas, and other potential hazards (I can't share the original file due to PII). Numbers and a few other programs parsed it correctly.
zq
parses it correctly, once I add a newline on the very last line of the file.I can reproduce the same behavior with this:
The text was updated successfully, but these errors were encountered: