Renamer is a batch file renaming tool that allows you to rename lots of files quickly and conveniently.
The tool provides two commands, rename
and validate
.
renamer:rename <config>
Arguments:
config
: The location of the config file.
See Configuration for more details.
renamer:validate <config>
Options:
root
: The directory to use as the root for the patterns.renamers
: Array of renamer configurations.pattern
: The glob pattern that specifies the paths to be renamed.actions
: Array of actions to be applied to paths.name
: The name of the action. See Actions for available names.options
: Options array for the action.
validators
: Array of validator configuration.pattern
:
Example:
---
root: "/Downloads"
renamers:
- pattern: "/Images/*.jpg"
actions:
- name: DropName
- name: AddDirectoryName
- name: AddNumber
options:
separator: "_"
validators:
- pattern: "/Images/*.jpg"
actions:
- name: validate
options:
pattern: "/^\\w+_\\d{4}\\.jpg$/"
Available actions:
AddDirectoryName
: Adds directory name to the filename. Options:separator
: Separator to use between the directory name and the file name. Defaults to no separator.
AddNumber
: Adds incremented number to the filename.separator
: Separator to use between the number and the file name. Defaults to no separator.
DropName
: Drops the filename.