1

我无法弄清楚这个的语法。我想通过将“.sql.sql763286”替换为“.txt”来简单地重命名以下内容:

我要这个:

C:/Documents and Settings/jdoe/Desktop/ealleip.sql.sql763286

成为:

C:/Documents and Settings/jdoe/Desktop/ealleip.txt

我尝试了在 Google、Rfunctions 等上找到的各种语法。我什至尝试了基本的:

file.rename ( 'C:/Documents and Settings/jdoe/Desktop/ealleip*', 'C:/Documents and   Settings/jdoe/Desktop/ealleip.txt')

没有任何效果。

谁能帮我?提前致谢。

4

1 回答 1

0
file.rename(from = paste0("C:/Documents and Settings/jdoe/Desktop/",list.files(path = "C:/Documents and Settings/jdoe/Desktop", pattern = "ealleip"), to = "C:/Documents and Settings/jdoe/Desktop/ealleip.txt")
于 2020-04-03T01:38:44.567 回答