我无法弄清楚这个的语法。我想简单地通过用“.txt”替换“.sql.sql763286”来重命名以下内容:
我想要这个:
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')
没有任何作用。
任何人都可以帮助我吗?提前谢谢。
答案 0 :(得分: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")