【发布时间】:2021-03-27 05:06:32
【问题描述】:
如何使用 Node.js 中 SheetJS 中的 XLSX 在 Excel 中删除工作簿的现有工作表行?
目前的代码:
const xlsx = require('xlsx');
// read the file
workBook = xlsx.readFile("todo-list.xlsx", {cellDates:true});
// read the worksheet
const shoppingList = workBook.Sheets["Do-Shopping"];
// delete a specific row
........ [here I dont know even how to start]
// write the data to the Excel file
xlsx.writeFile(workBook, 'todo-list.xlsx');
期望的结果:
但删除的行可以是任何人,例如第一行或第三行,不一定是最后一行。
我尝试搜索官方文档和堆栈,但我还没有找到答案。 :( 我是 Node js 的新手
你能帮帮我吗?
【问题讨论】:
标签: javascript node.js excel xlsx sheetjs