MySQL加载数据查询:反斜杠问题(\)

时间:2017-09-23 08:15:08

标签: mysql load-data-infile

我有csv149 column个文件,25K+ rowsMySQLMySQL LOAD DATA Query表中上传此文件我正在使用LOAD DATA local INFILE '/Dir/file.csv' INTO TABLE my_table FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 1 LINES
我的查询是:

Backslash (\)

我的查询工作正常,问题出现在我的文件有任何library("ggplot2") df <- read.table(file='vah_p_1',header =TRUE) p <- ggplot(df, aes(x = x, y = y)) + geom_point() + geom_smooth(data = df, method = "nls",size=0.4, se=FALSE,color ='cyan2', formula = y ~ a(exp^(x*b)-1),method.args = list(start=c(a=1.0,b=0.0))) p 个字符,列值得到干扰且文件单元格值没有插入正确的列时。有没有解决这个问题。
感谢

1 个答案:

答案 0 :(得分:2)

LOAD DATA local INFILE '/Dir/file.csv' INTO TABLE my_table FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\b' LINES TERMINATED BY '\n' IGNORE 1 LINES

在查询中使用'\ b'作为转义字符而不是'\'。