Created
September 4, 2020 04:15
-
-
Save njtierney/0e4580ca276fe018f4e1d7bc6e52e5fb to your computer and use it in GitHub Desktop.
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
chapters <- list.files(pattern = "^[0-9]") | |
new_chapters <- stringr::str_remove_all(chapters, "[0-9][0-9]-") | |
file.rename(from = chapters[1], | |
to = new_chapters[1]) | |
chapters <- list.files(pattern = "^[0-9]") | |
new_chapters <- stringr::str_remove_all(chapters, "[0-9][0-9]-") | |
purrr::walk2(.x = chapters, | |
.y = new_chapters, | |
.f = file.rename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment