References
Notes
This parameter is used to rename files. It requires use of the parameter
ReplaceWhat.
The rename operation is performed by specifying
- what part of a filename should be replaced and
- with which replacement a file should be renamed.
If a match has been found as specified by the ReplaceWhat parameter then
the following replacements can be applied:
- String replacement: any string
- Masked replacement: aa;[filename:];bb
A masked replacement supports masks for substitution in the filename with format
strings that are enclosed with [ and ].
The following format strings are supported:
- [date: date format ]
date format must be a valid Java data format string, e.g. yyyyMMddHHmmss, yyyy-MM-dd.HHmmss
etc.
- [filename:]
will be substituted by the original file name including the file extension
- [filename:lowercase]
will be substituted by the original file name including the file extension with
all characters
converted to lower case.
- [filename:uppercase]
will be substituted by the original file name including the file extension with
all characters
converted to upper case
Use with capturing groups
- For replacement "capturing groups" are used. Only the content of the capturing groups
is replaced.
- Multiple replacements are separated by a semicolon ";".
Example:
-
ReplaceWhat: (1)abc(12)def(.*)
-
ReplaceWith: A;BB;CCC
These setting result in the following rename operation:
- Name of original file: 1abc12def123.txt
- Name of renamed file: AabcBBdefCCC
Use without capturing groups
If no "capturing groups" are specified then the entire match is replaced.
Example:
-
ReplareWhat: Hello
-
ReplaceWith: 1234
These setting result in the following rename operation:
- Name of original file: Hello_World.txt
- Name of renamed file: 1234_World.txt
For further information see java.util.regex.Pattern