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 :: java script remove last character from string 
Javascript :: fetch function javascript 
Javascript :: execute bash program using js 
Javascript :: javascript is radio button checked 
Javascript :: date range filter 
Javascript :: javascript browser tab active 
Javascript :: save canvas as image from website 
Javascript :: mathjax new line 
Javascript :: Array Foreach Loop 
Javascript :: how to get on click id in event 
Javascript :: Navigator.pushReplacementNamed parameters 
Javascript :: @tippyjs/react 
Javascript :: js get first element of array 
Javascript :: firebase timestamp to date angular 
Javascript :: moment js get date 1 month 
Javascript :: bootstrap dropdown doesnt work with angular 12 
Javascript :: Random Integer 1-10 
Javascript :: Map in Javascript in LWC 
Javascript :: add new items in a select input using js 
Javascript :: bootstrap programmatically change tab 
Javascript :: patch request javascript 
Javascript :: react select npm 
Javascript :: js list of objects 
Javascript :: round decimal js 
Javascript :: js parse json 
Javascript :: string to currency javascript 
Javascript :: pretty alerts js 
Javascript :: react native location 
Javascript :: javascript Get Key/Values of Map 
Javascript :: make copy of date javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =