11 rename_file()
The function rename_file()
renames files in a directory based on a given pattern. It has three inputs:
filepath
, which specifies the desired directory of where the files to be renamed are;pattern_now
, which is a regular expression pattern of the file names as they currently are; andpattern_new
, which is the desired string that replaces the file names detected inpattern_now
.