Is xlsx to csv conversion possible ? #2789
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#2789
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?
Found this piece of code in the docs, but it doesn't seem to work. I have an input which is an s3 url of xlsx file
input https://modulus.s3-****/Content.xlsx
Is this the right way to do when input is an url also if its so how to generate worksheet from xlsx file
Assuming you are running in a newer version of NodeJS, use
fetch
to download the data and loop through the worksheets:If the file is not public, the AWS demo in the docs has an example using the official aws-sdk module to fetch an object, parse, and log the first worksheet
Thanks @SheetJSDev . This works independently.
But in my case I don't want to write into the file system. this Nodejs part which does the conversion need to send a response to the frontend and the frontend needs to download the file as csv. frontend send the url as request and backend needs to convert it and send back to UI to download. Can you please help me with that piece as well. Something similar to
XLSX.utils.sheet_to_csv(ws)
is a string, you can just send that in the response.Thanks @SheetJSDev , Will this work with axios as well ? It's throwing an error response.data.arrayBuffer is not a function
It's throws error in internal of XLSX.read ->TypeError: f.slice is not a function
`
misplaced close parentheses:
@SheetJSDev Still the same issue after correcting the line -> TypeError: f.slice is not a function
Corrected it, we needed response.data to be passed. Thanks @SheetJSDev
Corrected code