'Read specific rows of excel file in angular using xlsx package
I have read excel file in angular11 using xlsx package.
the bellow code read all rows which start from first row if data available and also skip from empty row. Now I want to start reading from specific row and also want to read empty row?
const target:DataTransfer=<DataTransfer>(evt.target);
if(target.files.length!==1) throw new Error('Can not select multiple
files'); const reader:FileReader=new FileReader();
reader.onload=(e:any)=>{
const bstr:string=e.target.result;
const wb:XLSX.WorkBook=XLSX.read(bstr,{type:'binary'});
const wsname:string=wb.SheetNames[0];
const ws:XLSX.WorkSheet=wb.Sheets[wsname];
// console.log(ws);
this.ExcelData=(XLSX.utils.sheet_to_json(ws ,{header:1}));
console.log(this.ExcelData);
}; reader.readAsBinaryString(target.files[0]);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
