sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

How to use different set of properties?

Open stfd opened this issue 3 years ago • 1 comments

Is there a way to use in one go two sets of properties for this method? Else, how to achieve this?

XLSX.utils.sheet_to_json(wb.Sheets[sheetname], {raw: false, range: firstRange} , {raw: true, range: secondRange})

If I create two arrays for each range then the merging will be a pain. But I don't see any other solution right now.

Thank you in advance!

stfd avatar Apr 01 '22 09:04 stfd

This is not really well-defined (for example, if the ranges overlap, what should be the order of the result?).

We could hypothetically add an iterator that walks the worksheet or add a callback option to sheet_to_json that would be called on each cell or each row. Or you could write a loop in user land as discussed in https://github.com/SheetJS/sheetjs#general-structures

SheetJSDev avatar Apr 05 '22 06:04 SheetJSDev

As stated earlier, the operation is not really well-defined. If you can propose a well-defined solution we can reopen the issue.

SheetJSDev avatar Aug 31 '22 03:08 SheetJSDev