I am using sheetjs. The empty cell is not getting populated in the json object including the header. I need that information also if a column is not entered. Here is my code:
workbook.SheetNames.forEach((sheetName) => {
let XL_row_object = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {defval:""});
console.log( JSON.stringify(XL_row_object ));
}
You can solved it with this part, at the begining, when you are including your SheetJS:
**const data = xlsx.utils.sheet_to_json((ws),{defval:""});**
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With