0
我目前正在使用NodeJS生成XLSX电子表格。我正在使用模块xlsx-populate在Express服务器上创建单页XLSX文件。如何将2个XLSX文件合并为一个使用NodeJS
我想知道是否有人知道使用Node将多个XLSX文件合并到一个文件中的方法。
谢谢!
实施例:
const xlsx = require('xlsx-populate');
xlsx.fromFileAsync('template1.xlsx')
.then((workbook) => {
// populate the workbook with stuff
return workbook.toFileAsync('spreadsheet1.xlsx');
})
.then(() => xlsx.fromFileAsync('template2.xlsx'))
.then((workbook) => {
// populate the other workbook with stuff
return workbook.toFileAsync('spreadsheet2.xlsx');
});
这无极链节省两个单独XLSX文件(spreadsheet1.xlsx,spreadsheet2.xlsx),每个从对应的模板文件构建的。 xlsx-populate不允许您从同一工作簿上的不同XLSX文件创建多个工作表,因此我想知道是否可以将两个工作簿合并到一个工作表中?
请包括任何相关的代码和链接到你在尝试中使用的引用。 – btl
您是否尝试过创建两个节点读取流并将它们管道化为单个写入流? – cheesenthusiast
@cheesenthusiast看到编辑,希望更清楚 – DCtheTall