如何使用nodejs将excel文件(XLSX)导入mysql [英] how to import excel file (XLSX) to mysql using nodejs
问题描述
我正在尝试将Excel文件中的数据导入到mysql中,就像使用node.js的行冒号一样 有什么我可以学习的参考资料或可以执行工作的nodejs中的任何模块或任何示例代码
I am trying to import data in excel file to mysql just like row colon using nodejs are there any references i can learn or any module in nodejs that does my work or any sample code
我已经在Google中搜索过,但是我只看到了mongodb和python的解决方案,
I have searched in google but i have seen solutions for only mongodb and for python ,
推荐答案
我想到的几种方法:
-
将要导入的Excel工作表保存为csv格式,然后将其导入到mysql中:cf. 如何将CSV文件导入MySQL表 到目前为止,这是最简单的方法,但是您可能会遇到引号,逗号和其他特质的麻烦.
Save the excel sheet(s) you want to import in csv format, and then import them into mysql : cf. How to import CSV file to MySQL table By far the simplest method, but you might run into trouble with quotes and commas and other idiosyncrasies.
使用JavaScript excel解析器读取excel文件,并使用代码直接执行mysql数据库中的更新:cf. https://github.com/SheetJS/js-xlsx 该选项比较复杂,但是如果要复制的文件很多,它可以使任务自动化.
use an javascript excel parser to read the excel file and perform directly with code the update in your mysql database : cf. https://github.com/SheetJS/js-xlsx That option is more complex but it allows you to automate the task should you have many files to copy.
这篇关于如何使用nodejs将excel文件(XLSX)导入mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!