我有csv
个149 column
个文件,25K+ rows
和MySQL
在MySQL 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
个字符,列值得到干扰且文件单元格值没有插入正确的列时。有没有解决这个问题。
感谢
答案 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'作为转义字符而不是'\'。