Node.js: Read from Excel File
ฝัง
- เผยแพร่เมื่อ 5 พ.ค. 2021
- In this video we show how you can read data from an excel file using node.js.
--------------------------------------------------------------------------------------------------------------
📚 If you want to get better in tech, check out my courses on Udemy with *35% Discount*.
Use Coupon Code "*TH-cam*" or click the links below!
🎓 Mastering PostgreSQL: Learning By Real Examples
www.udemy.com/course/masterin...
🎓 PostgreSQL: The Ultimate Exam
www.udemy.com/course/postgres...
🎓 Algorithm and Data Structures: The Ultimate Exam
www.udemy.com/course/algorith... - วิทยาศาสตร์และเทคโนโลยี
That's what I wanted. Searched for this for hours for such a simple thing. Thanks
Thank u so much, i like short and clear videos, so helpfull
Thank you for making this video, it really helps me
Thanks! This was very useful
Very useful!
Thanks very useful
Thanks a lot !!!
Why you have used .v in the for loop ?
how to import excel data and insert into a js file?
pal, do u know how to read ole object like images, .docx files, .pdf files that attached inside an xlsx file?
Can we do reverse of this i.e fetching terminal data to Msexcel
how to get only value of json array
for me it is getting error as .v is undefined
noob
Can you give this code?
var XLSX = require("xlsx");
var workbook = XLSX.readFile('C:/Users/Conferente/Documents/excel/arquivo.xlsx');
let worksheet = workbook.Sheets[workbook.SheetNames[0]];
for(let i = 2; i < 7; i++){
const id = worksheet[`A${i}`].v;
const name = worksheet[`B${i}`].v;
console.log({
id:id, name:name})
}
my code erro
C:\Users\Conferente\Documents\curso> node ./index.js
{ id: 200, name: 'felipe' }
C:\Users\Conferente\Documents\curso\index.js:7
const id = worksheet[`A${i}`].v;
^
TypeError: Cannot read properties of undefined (reading 'v')
at Object. (C:\Users\Conferente\Documents\curso\index.js:7:31)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
my code erro C:\Users\Conferente\Documents\curso> node ./index.js
{ id: 200, name: 'felipe' }
C:\Users\Conferente\Documents\curso\index.js:7
const id = worksheet[`A${i}`].v;
^
TypeError: Cannot read properties of undefined (reading 'v')
at Object. (C:\Users\Conferente\Documents\curso\index.js:7:31)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49