sheet_to_csv does not ignore rows with formulas that have blank output #2274
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#2274
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 have this formula in a column (for all rows) in an xlsx (default value of 1 if there is data in B2, B3, B4, etc, based on current row):
=IF(B2<>"",1,"")
I have this code to extract data from an xlsx file:
const data = XLSX.utils.sheet_to_csv(ws, { header: 0, blankrows: false, defval: '' });
The
console.log
ofdata
is (truncated):Is there a setting/property that I'm missing so that blank rows can be ignored, even if the rows have formulas? Currently, I iterate through
data
. The browser gets bogged down because I'm iterating through 2000 rows of blank data (the formulas exists in a column for 2000 rows).In code, I could skip the iteration if object representing B2 is blank to speed things up. But, how can I just ignore the rows that only have formulas?
Secondary question... Is there a way to use
defval
specific for a column? Something likeconst data = XLSX.utils.sheet_to_csv(ws, { header: 0, blankrows: false }, { b: { defval: '1' } } );
Can you log an example cell? In specific, look at the
v
property. A cell like{t: "s", v:""}
is "empty" but has a value that won't be ignoredThe options are
blankrows: false, strip: true