Anyway to tell sheet_to_json to output with the cell's value instead of text?
See original GitHub issueHello!
Been using XLSX.utils.sheet_to_json
, but hit a snag. The Excel workbook has a sheet with cells filled with integers. But when I run sheet_to_json
, it spits them out as strings.
Using this as the example:
A2: { t: 'n', v: 1995, w: '1995' },
B2: { t: 'n', v: 27, w: '27' },
C2: { t: 'n', v: 4, w: '4' },
I assume this is because it fills out object with the cell’s text representation – w
– instead of v
. Is there anyway for me to tell it to use v
instead?
I’m currently looping through the generated object to alter the keys I know should be numbers, but this tool would ideally not require the user to customize the converter per sheet. That could quickly get out of hand.
Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Anyway to tell sheet_to_json to output with the cell's value ...
Hello! Been using XLSX.utils.sheet_to_json , but hit a snag. The Excel workbook has a sheet with cells filled with integers.
Read more >Utility Functions - SheetJS Community Edition
aoa_to_sheet takes an array of arrays of JS values and returns a worksheet resembling the input data. Values are interpreted as follows: Numbers,...
Read more >Format date with SheetJS - javascript - Stack Overflow
So, I figured out that passing the raw option when converting the sheet to JSON outputs all cells as a string. So it...
Read more >Output Excel data as JSON - Office Scripts | Microsoft Learn
Learn how to output Excel table data as JSON to use in Power Automate. ... extract the hyperlink and use that instead of...
Read more >xlsx - npm
A common problem involves generating a valid spreadsheet export from data ... format_cell generates the text value for a cell (using number ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ha, went and poked on the code, and found it pretty quickly.
It’d be good to document this!
Raw option is actually very good. It’s a shame it’s not documented.