【发布时间】:2018-08-20 12:01:33
【问题描述】:
我有一个源文件夹 目标文件夹 我要从源文件夹复制到目标文件夹的文件列表,已保存到 .txt 文件中
listtocopy.txt 如下 - 不确定它是否重要,但它们是 Anabat ZC 文件。
S5281925.35#
S5282317.26#
S5290100.39#
S5281859.28#
S5281932.18#
S5290420.20#
我不想复制所有文件。
我是 R 新手 - 这是我目前所拥有的 - 但它不起作用。我认为它没有将列表识别为文件名的“列表”。
# Copy based on list
# identify the folders
current.folder <- "H:/Documents/1_PhD_Network/Auto_ID/Anabat7_11"
new.folder <- "H:/Documents/1_PhD_Network/Auto_ID/Scan_outputs"
#read listtocopy and assign to list
list<-read.delim("H:/Documents/1_PhD_Network/Auto_ID/Scan_outputs/listtocopy.txt")
# copy the files to the new folder
file.copy(list, new.folder)
【问题讨论】:
-
txt文件中的文件名是怎么存储的?你能告诉我们
listtocopy.txt的前几行吗? -
我想昨天有人问过类似的问题:stackoverflow.com/questions/51893525/…
-
抱歉它现在在上面
-
@milan 我试图使用该帖子中的信息但没有成功。