这是一个R解决方案.
# Manually enter the directories for the sub tasks
my_dirs
"desktop/folder_B/task/sub_task/",
"desktop/folder_C/task/sub_task/")
# Alternatively, if you want to programmatically find each of the sub_task dirs
my_dirs
# Grab all files from the directories using list.files in sapply
files
# Your output directory to copy files to
new_dir
# Make sure the directory exists
dir.create(new_dir, recursive = TRUE)
# Copy the files
for(file in files) {
# See ?file.copy for more options
file.copy(file, new_dir)
}
编辑以编程方式列出sub_task目录.