Created
September 5, 2021 15:38
-
-
Save sbalci/d1ec08be18d6a021772a6ff7cad19ef7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# batch rename files | |
Book1 <- read.csv(file.choose()) | |
wd <- dirname(file.path(file.choose())) | |
for (i in 1:dim(Book1)[1]) { | |
oldfilepath <- paste0(wd, "/", Book1[i,2]) | |
newfilepath <- paste0(wd, "/",Book1[i,1],".txt") | |
file.rename(from = oldfilepath, to = newfilepath) | |
} | |
# https://git.io/JuqOE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment