Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

exceljs read file from input

handleChange(e) {
  this.file = e.target.files[0]
},
handleImport() {
  const wb = new Excel.Workbook();
  const reader = new FileReader()

  reader.readAsArrayBuffer(this.file)
  reader.onload = () => {
    const buffer = reader.result;
    wb.xlsx.load(buffer).then(workbook => {
      console.log(workbook, 'workbook instance')
      workbook.eachSheet((sheet, id) => {
        sheet.eachRow((row, rowIndex) => {
          console.log(row.values, rowIndex)
        })
      })
    })
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: usehistory not found in react-router-dom 
Javascript :: js get array item by property 
Javascript :: react native port 
Javascript :: js convert double to int 
Javascript :: npm run start specific port 
Javascript :: replace globally in javascript 
Javascript :: jquery each data 
Javascript :: how to copy text on clipboard in react 
Javascript :: nodemail self signed certificate in certificate chain 
Javascript :: expo update react native 
Javascript :: remove last two elements array javascript 
Javascript :: append to array check if exists javascript 
Javascript :: javascript trigger button click using class name 
Javascript :: node js load animation 
Javascript :: javascript after dom ready 
Javascript :: jquery in react 
Javascript :: send a message to a specific channel discord.js 
Javascript :: node readFileSync json 
Javascript :: js mouse enter 
Javascript :: javascript full screen 
Javascript :: end code nodejs 
Javascript :: fs.writefile 
Javascript :: json post fetch 
Javascript :: how to use ionicons in react 
Javascript :: scroll to top in react 
Javascript :: jquery remove array element by key 
Javascript :: js rectangle collision 
Javascript :: Uncaught TypeError: this is undefined ApolloClient ApolloClient.ts:72 
Javascript :: datatables typeerror k is undefined 
Javascript :: how to wait in js 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =