JFRenamer allow the use of variables in insert and replace string. You can also format these variables.
Variable names are enclosed in less than '<'
and more then '>' , it may contain a format
that is separated from the variable name by the sign '¦' :
< name | format >
Predefined variables :
n : sort number
The 'n' variable corresponds to the sequence number in the list of files displayed.
The first file is numbered 1, the next 2, etc.
If you change the order of the list, such as sorting by date rather than by
name indexes will be updated.
'n' allow you to re-number your files. For example <n|i03>
will give you a file number (in the sort order you choose) on three
date : last modified date of the file
'date' gives you the last modified date of the file or directory. This can be useful for adding unveil a portion of the date of the file name.
Of course it must be used in conjunction with the date format 'd'.
Par exemple <date|dyyyy-mm-dd>
will give you the date of the file with the four-digit year, month and day two-digit and separated by '-'.
dir : name of the parent directory containing the file
'dir' is the name of the parent directory containing the file.
This can be very interesting if for example you have
directories of digital photos that you've named, and you want
apply this name to each photo.
level : level in directories
'level' is the levelof the directory containing the file. it's 1 for the base directory, 2 for a file in a subdirectory of your base directory, and so on.
You can use it when you rename files with the subdirectories option.
Regular expressions groups
In regular expressions you find group delimited by parentheses. These groups are numbered: the first encountered in the regular expression is numbered 1, the second 2...
You can use the number of a group like a variable. For example, if you have a regular expresion like that : '(\d+)(.*)$', you can use the string captured by the first group with '<1>'.
You can also use a format : '<1|i03>'. You can use the second group : this place the second group before the first and format the first like an integer on three digits '<2><1|i03>'
The format is prefixed by a letter indicating the nature of the format followed
a string that represents the format.
- 'i' : for an integer : May be optionally followed by a number preceded by a zero or a space. This allows you to specify the number of digits of your number.
- 'd' : pour une date : for a date: You can use the following elements to format your date.
For example dHH_mm give you the hour and minute, each on two characters and separated by an underscore '_'.
- 's' : for a string. May be followed by a number or two numbers separated by a dot.
The first number indicates the minimum number of characters and the second is the maximum number of characters.
For example s4.4 ensures that the resulting string will be four characters.