2021-03-26 13:26:14 +07:00
|
|
|
// const file = require('fs')
|
2021-03-26 08:42:51 +07:00
|
|
|
|
2021-03-26 13:26:14 +07:00
|
|
|
// file.readFile('./data/people.csv', 'utf-8', (err, data) => {
|
|
|
|
// if (err) {
|
|
|
|
// console.error(err)
|
|
|
|
// return
|
|
|
|
// }
|
2021-03-26 08:42:51 +07:00
|
|
|
|
2021-03-26 13:26:14 +07:00
|
|
|
// console.log(data)
|
2021-03-26 08:42:51 +07:00
|
|
|
|
2021-03-26 13:26:14 +07:00
|
|
|
// const rows = data.split(/\r?\n/);
|
|
|
|
// const header = rows[0].split(',').map(str => str.trim())
|
|
|
|
// console.log(header)
|
2021-03-26 08:42:51 +07:00
|
|
|
|
2021-03-26 13:26:14 +07:00
|
|
|
// });
|
2021-03-26 08:42:51 +07:00
|
|
|
|
2021-03-26 13:26:14 +07:00
|
|
|
var XLSX = require('xlsx')
|
|
|
|
var workbook = XLSX.readFile('./data/Sanagro Product and Catagory list.xlsx');
|
|
|
|
var xlData = XLSX.utils.sheet_to_json(workbook.Sheets['Sheet2']);
|
|
|
|
console.log(xlData);
|