我想在 *txt文件中将一个指定的字符/字符串改为双空格。在我的例子中,每个“x”都必须是双空格。
在我的例子中,我有:
my_text <- readLines("https://raw.githubusercontent.com/Leprechault/trash/main/test.txt")
my_text
[1] "\"x\""
[2] "\"Relatòrio de desempenho dos diferentes produtos testados\""
[3] "\"x\""
[4] "\"Vittia P&D\""
[5] "\"x\""
[6] "\"Data:2022-12-27\""
[7] "\"x\""
[8] "\"Período de tempo analisado\""
[9] "\"x\""
[10] "24"
[11] "\"Df\" \"Deviance\" \"Resid. Df\" \"Resid. Dev\" \"Pr(>Chi)\""
我的理想输出必须是:
my_text_new <- readLines("test_new.txt")
my_text_new
[1] ""
[2] ""
[3] "\"Relatòrio de desempenho dos diferentes produtos testados\""
[4] ""
[5] ""
[6] "\"Vittia P&D\""
[7] ""
[8] ""
[9] "\"Data:2022-12-27\""
[10] ""
[11] ""
[12] "\"Período de tempo analisado\""
[13] ""
[14] ""
[15] "24"
[16] ""
[17] ""
[18] "\"Df\" \"Deviance\" \"Resid. Df\" \"Resid. Dev\" \"Pr(>Chi)\""
拜托,能帮上忙吗?
提前感谢!
1条答案
按热度按时间uqdfh47h1#
请原谅我的unicode转义我没有葡萄牙语配置在这台电脑