-
-
Save sbalci/2894168c45c36aa897e9db0831c62b7d to your computer and use it in GitHub Desktop.
Rename all jpg files in a folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List the jpg files in the folder | |
old_files <- list.files("C:/ImageTest", pattern = "*.JPG", full.names = TRUE) | |
old_files | |
# Create vector of new files | |
new_files <- paste0("C:/NewFiles/file_",1:length(old_files),".JPG") | |
new_files | |
# Copy from old files to new files | |
file.copy(from = old_files, to = new_files) | |
# Clear out the old files | |
#file.remove(old_files) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment