Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

creating new column in sheetjs

$
0
0

I'm using sheetjs for determine excel cell errors.The main logic which i want is create a new column as first column because its overwrite to first column.I try to find for solution but i couldn't find anything about this.There is solution for row but column isnt exist :/.

My code in below

  let data = e.target.result, 
  fixedData = excelAll.fixdata(data), 
  workbook=XLSX.read(btoa(fixedData), {type: 'base64'}), 
  firstSheetName = workbook.SheetNames[0], 
  worksheet = workbook.Sheets[firstSheetName];
  results=XLSX.utils.sheet_to_json(worksheet);

  tickets=results;

  if(name=="Stok 2018 ver2.xlsx"){

    errorList=stockValidationFunctions.excelNullorNaN(tickets)

    let i
    for(i=0;i<errorList.length;i++)
    {
      lastList.push(errorList[i])
    }
    XLSX.utils.sheet_add_json(worksheet,lastList)
    XLSX.writeFile(workbook,"stokHatalar.xlsx")

    console.log(lastList)
  }
  if(name=="Reçete 2019.xlsx"){
    errorList=formulaValidationFunctions.excelNull(tickets)
    let i
    for(i=0;i<errorList.length;i++)
    {
      lastList.push(errorList[i])
    }
    XLSX.utils.sheet_add_json(worksheet,lastList)
    XLSX.writeFile(workbook,"reçeteHatalar.xlsx")
    console.log(lastList)

  }

}
reader.readAsArrayBuffer(f);

commit('handle_Drop', lastList);
},

The ss is what i want

But it doesnt i couldn't handle it


Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>