0

我想将 CSV 文件迁移到我的数据库中。我正在使用终端窗口来执行查询。我的问题是我正在迁移的 CSV 文件有空行,在迁移(重复的主 ID)到我的数据库时会产生错误。

我想知道如何只导入第一列没有空值的行?

4

2 回答 2

0

Workbench 应该可以选择在导入时忽略空白行。否则,您总是可以编写一个快速脚本来从 csv 文件中删除空白行,然后导入。

于 2014-03-09T04:54:24.097 回答
0

Ultimately, if your input is giving you wrong results, you must change the input in order to change the results.

For example, you could open the CSV in excel, sort by the first column, delete all the lines that are now grouped together with null in the first column, save as new csv file, import to mysql.

于 2014-03-09T23:45:10.323 回答