rename_seq | R Documentation |
Rename a series of files and add an incremental numeric prefix to the filenames. For example, files ‘a.txt’, ‘b.txt’, and ‘c.txt’ can be renamed to ‘1-a.txt’, ‘2-b.txt’, and ‘3-c.txt’.
rename_seq(
pattern = "^[0-9]+-.+[.]Rmd$",
format = "auto",
replace = TRUE,
start = 1,
dry_run = TRUE
)
pattern |
A regular expression for |
format |
The format for the numeric prefix. This is passed to
|
replace |
Whether to remove existing numeric prefixes in filenames. |
start |
The starting number for the prefix (it can start from 0). |
dry_run |
Whether to not really rename files. To be safe, the default is
|
A named character vector. The names are original filenames, and the vector itself is the new filenames.
xfun::rename_seq()
xfun::rename_seq("[.](jpeg|png)$", format = "%04d")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.