batchRename: Batch rename files

Description Usage Arguments Author(s) Examples

View source: R/RFunctions.R

Description

Replace pattern with replacement for all files in the specified folder matching the specified filefilter. Function is run for its side effect of renaming files.

Usage

1
batchRename(folder = getwd(), filefilter = NULL, pattern, replacement)

Arguments

folder

Path to the folder containing files to be renamed.

filefilter

an optional regular expression. Only file names which match the regular expression will be returned.

pattern

regular expression describing the pattern in filenames to be replaced.

replacement

regular expression describing the pattern in filenames to replace pattern with.

Author(s)

Caspar J. van Lissa

Examples

1
2
3
file.create("1 a.txt")
file.create("1 b.txt")
batchRename(filefilter = "\\d \\w\\.txt", pattern = "\\s", replacement = "")

cjvanlissa/motley documentation built on Sept. 23, 2019, 7:39 p.m.