Is it possible to start parsing not from the first row? #404
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#404
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?
Hey,
I am trying to import an excel file which the first 2 rows are not the content I need, and I somehow need to start from the 3rd row(my 3rd row is the columns, and so on).
Is it possible? If not, Deleting the entire first and second rows is a good solution as well..
Tought about putting it as an option on XLSX.read but with no success..
Any suggestions?
Thanks!
Try this
@ronilitman if you want to skip the first two rows (so your header is in the third row and the data starts in the fourth row), rewrite the sheet's range:
Then all of the utility functions will automatically skip those rows.
As stated in the earlier comment, you can always directly manipulate the worksheet range and the various utilities do the right thing.
However, there are certain features like merge cells which make it really difficult to do properly. For example, suppose you had a worksheet where the merge extends from a row you want to skip into a row you want to keep:
With this example, how do you handle that merge cell B1:C2 if you intend to skip the first row? Do you skip it? Do you retain it? Do you twist the cell to fit in the range (in this case, rewriting the merge cell as if it only merge B2:C2)? There is no good answer to the question. Manipulating the range is currently equivalent to the first case because any other cell in the range is undefined (ws.B1 is defined but ws.B2 and ws.C1 and ws.C2 are all undefined).
In absence of an obvious strategy, I'm inclined to close. @ronilitman if you can give a compelling argument in favor of one of the strategies, it's not too difficult to add in.