将数据从Excel电子表格或CVS导入MySQL [英] Import Data from Excel Spreadsheet or CVS into MySQL

查看:106
本文介绍了将数据从Excel电子表格或CVS导入MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个电子表格,实际上只有一个复杂的表格.我基本上将电子表格转换为cvs,并使用常规脚本生成INSERT脚本.

I have a spreadsheet which really has only one complicated table. I basically convert the spreadsheet to a cvs and use a groovy script to generate the INSERT scripts.

但是,我无法使用包含28个字段的表来执行此操作,该表包含电子表格中某些字段中的数据,这使得导入CVS更加复杂.因此,新CVS中的字段无法正确区分,或者我的脚本没有对此加以说明.

However, I cannot do this with a table that has 28 fields with data within some of the fields on the spreadsheet that make importing into the CVS even more complicated. So the fields in the new CVS are not differentiated properly or my script has not accounted for it.

有人对更好的方法有任何建议吗?谢谢.

Does anyone have any suggestions on a better approach to do this? Thanks.

推荐答案

看看 LOAD DATA INFILE 语句.它将帮助您将CSV文件中的数据导入表中.

Have a look at LOAD DATA INFILE statement. It will help you to import data from the CSV file into table.

这篇关于将数据从Excel电子表格或CVS导入MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆