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

Update spreadsheet.js to handle quotes cells #102

Merged
merged 2 commits into from
Feb 13, 2025
Merged

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Feb 13, 2025

As reported in https://groups.google.com/d/msgid/dataverse-community/ef52665f-2348-413b-9181-0aad860316c1n%40googlegroups.com?utm_medium=email&utm_source=footer, the current previewer isn't handling cells that are in quotes (and have a comma inside them).

This PR tries to address that by setting delimitersToGuess: to just support the '\t' and ',' delimiters we use for tsv/csv files. The PR also sets the quoteChar to '"'. It's not clear that's needed.

I did some basic testing at QDR and these changes fix the problem in email and don't appear to break parsing of existing csv/tsv files that don't have commas inside quoted tab separated cells.

As reported in https://groups.google.com/d/msgid/dataverse-community/ef52665f-2348-413b-9181-0aad860316c1n%40googlegroups.com?utm_medium=email&utm_source=footer, the current previewer isn't handling cells that are in quotes (and have a comma inside them). 

This PR tries to address that by setting the quoteChar used during parsing. Alternately, we may need to set delimitersToGuess: to avoid all but the correct one for a given mimetype.
@qqmyers qqmyers merged commit 59fca11 into develop Feb 13, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant