How to Converting data from Xlsx to Json, in Web Workers #2962
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#2962
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?
Hello, I'm converting big data from xlsx to json, as a result of which the interface freezes, when trying to take out the XLSX.utils.sheet_to_json process in webWorker, an error occurs: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'call')
For very large datasets:
use the option
dense: true
when reading the file https://docs.sheetjs.com/docs/demos/bigdata/stream#dense-modeuse
stream.to_json
instead of converting everything at once. The current live demo usesstream.to_csv
(https://docs.sheetjs.com/docs/demos/bigdata/stream#live-demo) but you can adapt that to useto_json
instead.If the browser still locks up, the file may be too large for the current techniques. Do you have an estimate for the file size and the number of rows/columns/text cells/numeric cells?
The file size is 10+ MB, your solution helped me, but there was a problem with the XLSX.WriteFile method, which does not work in Web Worker
writeFile
does not work in a web worker. https://docs.sheetjs.com/docs/demos/bigdata/worker#creating-a-local-fileThe "Creating a local file" example in the docs includes a live example