问题描述
- node.js把json放到excel
-
得到一个json 或者是一个数组 比如[a,b,c][1,2,3][4,5,5]存到excel里面
下面是我的代码 希望大神帮我补全
var xlsx = require("xlsx");
var workbook =xlsx.readFile("D:/node/test.xlsx");
var myArray = new Array();
myArray[0] = 'a';
myArray[1] = 'b';
myArray[2] = 'c';
var first_sheet_name = workbook.SheetNames[0];
var address_of_cell = 'A1';
/* Get worksheet /
var worksheet = workbook.Sheets[first_sheet_name];
/ Find desired cell /
var desired_cell = worksheet[address_of_cell];
/ Get the value */
//var desired_value = desired_cell.v;
console.log(workbook);
时间: 2024-09-20 16:10:22