Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

xlsx to json using xlsx react

const readUploadFile = (e) => {
    e.preventDefault();
    if (e.target.files) {
        const reader = new FileReader();
        reader.onload = (e) => {
            const data = e.target.result;
            const workbook = xlsx.read(data, { type: "array" });
            const sheetName = workbook.SheetNames[0];
            const worksheet = workbook.Sheets[sheetName];
            const json = xlsx.utils.sheet_to_json(worksheet);
            console.log(json);
        };
        reader.readAsArrayBuffer(e.target.files[0]);
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue 3 hooks 
Javascript :: javascript change video poster 
Javascript :: javascript between 
Javascript :: window.scrollTo Id sample code 
Javascript :: zustand simple counter 
Javascript :: how to get current template in vuejs 
Javascript :: request get response node js 
Javascript :: sequelize.fn 
Javascript :: append to map javascript 
Javascript :: Cannot use import statement inside the Node.js REPL, alternatively use dynamic import 
Javascript :: base64 encode in javascript 
Javascript :: Material-ui add alarm icon 
Javascript :: angular detect chromebook 
Javascript :: jquery on change on multiple elements 
Javascript :: javascript download html to pdf 
Javascript :: how to copy text from input through button click js 
Javascript :: let var diferencia 
Javascript :: join array of objects javascript 
Javascript :: convert namednodemap to object 
Javascript :: use font awsome in react 
Javascript :: accept only video in input type file below size 
Javascript :: completablefuture async example 
Javascript :: get json data into array of object 
Javascript :: regex[ress for password 
Javascript :: javascript delay some seconds 
Javascript :: React-redux and redux 
Javascript :: jquery option second 
Javascript :: Date object for local time and date 
Javascript :: accessing objects inside array 
Javascript :: angular material dropdown menu 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =