Skip to content
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

Empty quoted data consumes next cell #45

Open
cstiborg opened this issue Jul 6, 2023 · 0 comments
Open

Empty quoted data consumes next cell #45

cstiborg opened this issue Jul 6, 2023 · 0 comments

Comments

@cstiborg
Copy link

cstiborg commented Jul 6, 2023

I have a postgres csv file which contains a number of quoted empty cells like the following:
"cell1","","cell3",NULL,"cell5"

In this case, despite five fields are present in the row, only four will be seen:

  • "cell1"
  • "","cell3"
  • NULL
  • "cell5"

I've made a patch for this copied in below. In the patched line I amend the check for an escape sequence to also validate that last_quote_location wasn't the first character of the cell and the following character isn't a delimiter. I.e. that we don't have a cell like the second cell above.

csv2.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant