英文:
MySQL LOAD DATA ignore quotes
问题
我还没有找到正确的控制字符组合来导入CSV文件。实际上,文件是以插入符(^)作为分隔符的。偶尔会有字段包含嵌入的引号,我希望将其作为字面量导入。一些导入数值的例子是 ^""001454483^ 和 ^""Sambo""^. 如果 "字段分隔符" = ^,并且"包围符"和"转义符" = 双引号,那么将会生成错误。将"包围符"设置为 ^,那么会陷入无尽循环。同时将"转义符"改为 ~ 也会创建一个无尽循环。我不需要转义插入符(^)。我应该使用什么设置?需要确切地导入^^之间的内容。
英文:
I have not found the right combination of control characters when importing a CSV file. Actually the file is delimited by caret (^). Occasionally a field will have embedded quotes which I want to import as literals. A couple examples of import values are ^""001454483^ and ^""Sambo""^. If "Fields terminated by" = ^, and enclosed by and escaped by = double quote, then an error is generated. Adding "enclosed by" set to ^, then it is an endless loop. Also changing "escaped by" to ~ also creates an endless loop. I don't have a need to escape the ^. What settings should I use?
Need to import exactly what is between ^^.
答案1
得分: 1
"load data ... fields terminated by '^' enclosed by '' ..."
英文:
load data ... fields terminated by '^' enclosed by '' ...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论