Skip to content

Commit

Permalink
Update spreadsheet.js to handle quotes cells
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
qqmyers authored Feb 13, 2025
1 parent 4711800 commit 860ea28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions previewers/betatest/js/spreadsheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function writeContent(fileUrl, file, title, authors) {
var csv = e.target.result;
var data = Papa.parse(csv, {
header: true,
skipEmptyLines: true
skipEmptyLines: true,
quoteChar:'"'
})

handsontableContainer.innerHTML = '';
Expand All @@ -42,4 +43,4 @@ function writeContent(fileUrl, file, title, authors) {
request.send();
}



0 comments on commit 860ea28

Please sign in to comment.