Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

read excel file through nodejs

// Requiring module
const reader = require('xlsx')
  
// Reading our test file
const file = reader.readFile('./test.xlsx')
  
// Sample data set
let student_data = [{
    Student:'Nikhil',
    Age:22,
    Branch:'ISE',
    Marks: 70
},
{
    Student:'Amitha',
    Age:21,
    Branch:'EC',
    Marks:80
}]
  
const ws = reader.utils.json_to_sheet(student_data)
  
reader.utils.book_append_sheet(file,ws,"Sheet3")
  
// Writing to our file
reader.writeFile(file,'./test.xlsx')
Comment

how to read excel file in nodejs


//npm
npm install exceljs
//yarn
yarn add exceljs

https://www.npmjs.com/package/exceljs
Comment

PREVIOUS NEXT
Code Example
Javascript :: copy folder in nodejs 
Javascript :: reach last array js 
Javascript :: javascript set header text 
Javascript :: java script removing first three indexes 
Javascript :: Difference Between for...of and for...in Statement 
Javascript :: js code 
Javascript :: local time 
Javascript :: how to store variable in local storage angualur 
Javascript :: working of a recursive function 
Javascript :: codewars js Shortest Word 
Javascript :: electron hot reload 
Javascript :: hide react source 
Javascript :: javascript save multiple images to server 
Javascript :: how to display message in javascript 
Javascript :: empty array length javascript 
Javascript :: building an array of a numbers javascript 
Javascript :: javaScript add() Method 
Javascript :: add array type to sequelize migration 
Javascript :: add a slash to string in javascript 
Javascript :: ajax stand for 
Javascript :: even numbers in an array 
Javascript :: how to refrence schema in my mongoose schema 
Javascript :: favicon express js 
Javascript :: what would (int) (Math.random()) output 
Javascript :: array for numbers 
Javascript :: react js props lara css uygulama 
Python :: pandas show all rows 
Python :: number table python 
Python :: how to start python quick server 
Python :: python datetime tomorrow date 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =