Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
您可以将 xls 文件转换为简单的 csv 文件,然后使用 LOAD DATA INFILE 语句。
在 SQL 客户端中键入“help LOAD DATA”以获得有关此语句的更多帮助。
You can convert your xls file to a simple csv file, and then use the LOAD DATA INFILE statement.
Type "help LOAD DATA" in your SQL client to get more help on this statement.
Excel数据默认没有Schema信息。我最近发现了一个在线工具,可以将 Excel 转换为 MySQL:
http://xlstosql.brightants.com/
输入:
Excel (xls / xlsx )包含数据的文件(有一些特定的格式,你必须检查文档)
输出:
一个.sql导出文件(可以导入到MySQL数据库中)
对我来说效果很好。
另一个效果很好的选项是使用 CSV 中间体。 Excel 可以导出为 CSV,MySQL 可以通过 LOAD 命令或 PHPMyAdmin 导入 CSV。但我每次都必须手动添加列、数据类型,并且之前导出到 CSV 的速度似乎较慢。
有没有基于 Excel 的插件可以直接执行此操作?
Excel data does not have Schema information by default. I came across an online tool recently that allows conversion from Excel to MySQL:
http://xlstosql.brightants.com/
Input:
Excel (xls / xlsx) file which contains data (has some specific format, you will have to check on the documentation for that)
Output:
A .sql export file (which can be imported into a MySQL database)
Works pretty well for me.
The other option that worked fine, was using the CSV intermediate. Excel can export to CSV and MySQL can import CSV via LOAD command or PHPMyAdmin. But I have to add the column, data-types manually every-time, and seems a slower option to export to CSV before.
Is there any Excel based plugin that can do this directly?
将 .xls/.xlsx 文件保存到 .csv 文件,然后逐行解析它,然后使用
arrayexplode ( string $delimiter , string $string [, int $limit ] )
和;< /code> 作为
$delimiter
Save your .xls/.xlsx file to .csv file then parse it line by line then use
array explode ( string $delimiter , string $string [, int $limit ] )
with;
as$delimiter
只需
Simply