简体   繁体   English

明智地在Node.js中的Excel文件列中追加数据

[英]Append data in excel file column wise in nodejs

I am working to append data in csv file using fs.appendFileSync. 我正在使用fs.appendFileSync将数据附加到csv文件中。 I can easily append the data row wise but i can't find any way to append data in excel file column wise. 我可以很容易地明智地追加数据行,但是我找不到任何方法可以明智地在excel文件列中追加数据。 For example, first fill column 'A' with data then column 'B' and so on. 例如,首先用数据填充列“ A”,然后填充列“ B”,依此类推。 I am wondering if some one help me in this regard. 我想知道是否有人在这方面帮助我。 Thanks in advance! 提前致谢!

It will be very hard to do this task using fs.appendFileSync. 使用fs.appendFileSync很难完成此任务。 Also, try not to use SYNC methods whenever possible. 另外,请尽量不要使用SYNC方法。

For your problem I would recommend this npm module: https://www.npmjs.com/package/exceljs 对于您的问题,我建议使用此npm模块: https ://www.npmjs.com/package/exceljs

You can manipulate excel files using it. 您可以使用它来操纵excel文件。 To add a rows and columns, just check docs. 要添加行和列,只需检查文档。 For example: https://www.npmjs.com/package/exceljs#rows 例如: https : //www.npmjs.com/package/exceljs#rows

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM