rename_unit_files: Rename files based on a pattern

View source: R/rename_unit_files.R

rename_unit_filesR Documentation

Rename files based on a pattern

Description

Searches a directory recursively and replaces files by passing arguments to gsub()

Usage

rename_unit_files(
  pattern,
  replacement,
  dir_path,
  ignore.case = FALSE,
  perl = TRUE,
  inner = FALSE
)

Arguments

pattern

a regular expression to be passed to gsub(); e.g. "Short[ ]?Title" Will grab 'ShortTitle' and 'Short Title' prefixes and replace them with the replacement string

[ ]: R:%20

replacement

the string passed to gsub() that will replace the selected pattern in your file names

dir_path

the folder or containing all the files you want to be changed.

ignore.case

if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching. default= FALSE

perl

logical. Should Perl-compatible regexps be used? default=TRUE

inner

logical. Is this being run recursively within a rename_unit_files call? If TRUE, suppresses output. default=FALSE


galacticpolymath/GPpub documentation built on April 5, 2025, 6:04 p.m.