QUestion: correct way to merge sheets #3181
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#3181
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?
As in subject, i don't know the correct way to merge multiple sheets.
Should i iterate the rows, or is there an XLSX.utils method to help adding sheet data at the end of document?
Can i see a code example please?
No built-in operation yet (we should probably make some sort of generic utility library for this).
If you just want to pull data, you can use an array of arrays intermediate:
sheet_to_json
with the optionheader: 1
to get an array of arrays from the data in the source worksheet:https://docs.sheetjs.com/docs/api/utilities/array#array-of-arrays
sheet_add_aoa
with the optionorigin: -1
to add to the bottom of the sheet:https://docs.sheetjs.com/docs/api/utilities/array#array-of-arrays-input
If you wanted more features, it becomes a bit of a grind since you need to correct formulae and shift merges and other structures.