Resolving Incorrect Parsing of Parentheses-Inclusive Strings in CSV file #2968
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2968
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There is an issue where if a cell in a CSV contains a string like
256(3)
,it is incorrectly parsed as
-2563
.What could be the reason for this, and how can i solve the problem?
CSV and other plaintext formats mix "content" (the raw value) and "presentation" (the formatted text). When parsing CSV, the library applies heuristics (it "guesses" the implied value) to recover values. This is how a row like
1,2,3
is interpreted as 3 numeric cells.Excel can generate that specific CSV string
256(3)
in at least 3 different ways:256(3)
2563
with format#(#)
-2563
with format#(#);#(#)
Pass
raw: true
toXLSX.read
orXLSX.readFile
to completely suppress value parsing (https://docs.sheetjs.com/docs/api/parse-options in the docs)If you have any other misparsed cells, please comment here and we'll take a closer look.