MySQL LOAD DATA忽略引号

huangapple go评论49阅读模式
英文:

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 '' ...

huangapple
  • 本文由 发表于 2023年5月18日 09:04:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76277116.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定