将文件导入SQLite时如何忽略损坏的行?

时间:2012-12-11 01:10:03

标签: sql sqlite

在Linux上使用SQLite 3将文件导入表时,有没有办法忽略文件​​中的损坏行?文件大小为13GB,文件中有大约50条损坏的行,因此手动删除这些行并不容易。任何建议都将不胜感激。

sqlite> .separator "|"
sqlite> .import myFile.dat myTable
myFile.dat line 29046575: expected 18 columns of data but found 3

1 个答案:

答案 0 :(得分:0)

升级到sqlite 3.8.10。

当存在不匹配的行时,似乎3.7.x使整个导入无效。 3.8.x似乎会打印警告,但会继续导入。