How to copy select files from subfolders to a single folder based on file paths saved in excel?

27 views Asked by At

I have a folder with several subfolders containing maybe 10,000 files and I'm interested in pulling out specific files with those different subfolders. I know which files I want pulled out, the file names and paths are saved in an excel file but I keep getting errors that I can't figure out how to navigate around.

file.copy(file.path(Relevant$FilePath), new_location)
  • Relevant = excel file with file path of select files
  • FilePath = column header containing the file path for each individual file
  • New_location = folder I'm trying to move the files to

I've tried copying the files to different location and get one of two errors. The first is

In file.copy(file.path(Relevant$FilePath), new_location) :
  problem copying H:\Outputs\test1.wav to C:\Box\new_location\test1.wav: No such file or directory

Another error I see is

Error in file.copy(file.path(Relevant$FilePath), new_location) : 
  more 'from' files than 'to' files
0

There are 0 answers