specify custom Sheet2JSONOpts config per possible header? #2958
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2958
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
I'm processing a csv where the columns values are either all numbers that need to be processed as strings, or dates like '5/21/2023' that need to be processed as dates.
Using the 'raw' option in Sheet2JSONOpts, I can get the numbers to register as strings.
Using the 'dateNF' option, I can get the dates to properly register as dates.
However, cannot get both to work at the same time.
Is it possible to specify multiple Sheet2JSONOpts configs per header, or any other way of doing this?
Would rather not have to do post mapping/converting as each csv is massive.
I know all the possible headers and what type they will be, just not which order they come in and if they will appear at all.
Thanks!
Example:

output using 'raw' option:

=numbers->string ok, but dates not processed
output using 'dateNF' option:

=numbers->numbers and not string, dates are properly processed though
(using: "xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz")