I am converting the data in an excel file into JSON with the XLXS library using the sheet_to_json method, now it works fine for me, but I need to exclude some rows, in this case the rows that have red fill color.
in this case I want to exclude the rows with the ID 3 and 7
Can someone guide me if it is possible to do this operation with the currently used library?
Attach the code that I currently use:
return new Promise((resolve, reject) => {
let aTemp = [];
if (file && window.FileReader) {
const reader = new FileReader();
reader.onload = async function (e) {
const data = e.target.result;
const workbook = XLSX.read(data, {
type: "binary",
});
workbook.SheetNames.forEach((sheetName) => {
excelData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {
header: 1
});
aTemp.push(...excelData);
});
resolve(aTemp);
}.bind(this);
reader.onerror = function (ex) {
reject(ex);
};
reader.readAsBinaryString(file);
}
});