0
我有一个输入csv文件,Input.csv
,看起来像这样:停机v更改“”到” CSV文件中
"VariableOne";"VariableTwo"
"Hello, how are you?";"I'm fine, thank you!"
"He said ""how are you?"" to her";"She responded ""I'm fine, thank you!"" and then left."
"Good bye!";"Good bye!"
注意双引号,""
,行情可变文本内。
现在,我的R程序看起来像这样:
Data <- read.csv2("./Input.csv",header=TRUE, sep=";", quote="\"")
write.table(Data,file="Output.csv",sep=";",row.names=FALSE, quote=TRUE)
该程序产生下面的输出CSV文件,Output.csv
:
"VariableOne";"VariableTwo"
"Hello, how are you?";"I'm fine, thank you!"
"He said \"how are you?\" to her";"She responded \"I'm fine, thank you!\" and then left."
"Good bye!";"Good bye!"
注意,双引号,""
,已被替换\"
。这对我来说会导致很多问题,我希望双引号""
不会改变输出。
我该如何做到这一点?
谢谢!那样做了! – Speldosa 2015-02-05 19:56:05