mysql将csv数据导入表

时间:2013-12-04 20:42:04

标签: mysql csv import

我有一个csv值文件,我使用php my admin填充了我要导入mysql表的数据。

导入csv文件时,出现此错误消息“第11行的CSV输入中的列数无效。”

该表有6列。

这是第11行的文字(我用“+”作为列的分隔符):

bue+rio+Full day all inclusive fly fishing dorado y tararira en San Pedro+buerio160+<a href='bue1_10.php#toursbue' title ='click for photos and detailed information about Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience'>Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience</a> (full day).+<b><a href='bue1_10.php#toursbue' title ='click for photos and detailed information about Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience'>Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience</a></b>.<br>Enjoy the incomparable experience of fly fishing Dorado and Tararira (dogfish), surrounded by a unique landscape.<br>Located very close to Buenos Aires city (a 1-hour-and-a-half drive), San Pedro consists of a delta where hundreds of streams and channels get together, giving home to these species, so desired by fly fishermen. This tour is done in private basis (full day).

正如您所看到的,有5个“+”符号分隔6列。无论如何我得到无效的列计数错误。

我已经尝试了很多不同的事情来解决这个问题超过2个小时,所以我感到很沮丧(而且是个白痴!)。希望有人可以启发我的错误。 如果需要,我有完整的csv文件。

非常感谢!

佛瑞德

1 个答案:

答案 0 :(得分:0)

我只计算第11行的4'+',这意味着该行的csv中会有5列,而你的表有6列

bue
+
rio
+
Full day all inclusive fly fishing dorado y tararira en San Pedro+buerio160
+
<a href='bue1_10.php#toursbue' title ='click for photos and detailed information about      Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience'>Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience</a> (full day).
+
<b><a href='bue1_10.php#toursbue' title ='click for photos and detailed information    about Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience'>Dorado & Tararira (dogfish) Fly Fishing all inclusive Experience</a></b>.<br>Enjoy the incomparable experience of fly fishing Dorado and Tararira (dogfish), surrounded by a unique landscape.<br>Located very close to Buenos Aires city (a 1-hour-and-a-half drive), San Pedro consists of a delta where hundreds of streams and channels get together, giving home to these species, so desired by fly fishermen. This tour is done in private basis (full day).