开发者

Problem in importing the CSV file containing multiple commas in a sigle field

I am having an issue with importing a large(60MB) CSV file in MYSQL DB. The problem arises when an address field has multiple comma seperated values e.g. home no, street no, town etc.

I tried to use BigDump for it but, the problem did not solved because of a single field containing multiple com开发者_开发问答ma separated values.

Any idea, suggestion or solution from experts how to handle it? Please reply, because I am sick of it.

Thanks


Have you tried using LOAD DATA INFILE statement. It allows you to carefully control the CSV dialect.


Is the address enclosed in double-quotes? Like:

Name,Address,Email
John Smith,"123 Elm Street,New York,NY",john.smith@gmail.com

If it's not enclosed in double-quotes but contains commas, it's not a valid CSV file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜