I have a directory in windows with multiple sub-directories. I also have a list of file names that I would like to search for within the directory structure (to retrieve exact path)
This works fine for a single value as below (current.folder is a variable for the main directory) -
files <- list.files(current.folder,
pattern = test,
recursive = TRUE,
full.names = TRUE)
I can then use the returned path to do file.copy.
The problem I am now having is applying that function to multiple file names stored in a dataframe or even a vector.
I've tried referencing them in the pattern argument (which only returns for first value) and used a for loop on a set of just two filenames (returns blank).
Am I using the wrong technique or just not finding the correct setup?
Edit for clarification - test refers to value - "1-5FX3C7P_1-5FX3C8T_JNJLFSPROD-ZZFDA-CDRH-AERS-3500A-01162017131543-1-5FX3C7P.xml"