I have a directory full of folders
, and in each of those folders is a .tsv file I need to extract to a different directory (so that all the files in the folders are together in one folder)
My idea was to write a for loop in R which would get a list with all files in root directory, open those, copy the .tsv file to the new location
it would look something like this:
Files <- list.files("directory")
directory1 <- "root directory"
directory2 <- "place they need to go"
for (i in files){
file.copy(from = directory1,
to = directory2)}
this however does not work.