Hi community
In a another question Im make something very same to my current questions today .
Maybe was not the best solution but in this case worked well.
Now, I'm need move or copy 36.000 files to other order directory.
Im get the to path, source and destination. But when Im try to run my Rstudio collapse
# run well wit this example
df = data.frame(
source = c('\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR ODISEA\\20230227\\bean\\seed/G 1.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR ODISEA\\20230227\\bean\\seed/G 2.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR ODISEA\\20230227\\bean\\seed/G 3.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR ODISEA\\20230227\\bean\\seed/G 4.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR ODISEA\\20230227\\bean\\seed/G 5.jpg'),
destination = c('\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR GENESYS\\20230303\\acn\\G1\\G1 seed.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR GENESYS\\20230303\\acn\\G2\\G2 seed.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR GENESYS\\20230303\\acn\\G3\\G3 seed.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR GENESYS\\20230303\\acn\\G4\\G4 seed.jpg',
'\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR GENESYS\\20230303\\acn\\G5\\G5 seed.jpg'))
file.copy(from = df$source, to = df$destination)
url <- "https://docs.google.com/spreadsheets/d/1qoHxBRfchDanYc8pvTH8esa6ANL-N-Ja/edit#gid=430580483/export?format=xlsx"
download.file(url, "acn.xlsx")
Im get the all the path, because create the destination folders.
# Im try with this other form but the path source are not correct
source_dir <- '\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR ODISEA\\20230227\\bean\\seed\\'
dest_dir <- '\\\\ALLIANCEDFS.ALLIANCE.CGIAR.ORG\\CL07_GRPhistoric\\GRP_OPERATION\\DOCUMENTATION\\ODISEA GENESYS\\SERVIDOR GENESYS\\20230303\\acn\\'
# loop over the file numbers and copy each file
for (i in 1:5) {
source_file <- paste0(source_dir,'G', i ,'.jpg')
dest_file <- paste0(dest_dir, 'G', i, '\\G', i, ' seed.jpg')
file.copy(from = source_file, to = dest_file)
}
Any suggest, or link or other way is very useful.