Dialog box - Multi-rename tool
With this dialog box, you can rename a list of files selected in Total Commander. Instead of * and ? wildcards, this function uses placeholders in brackets []. The new names are immediately shown in the result list, but the files are not renamed until the Start! button is pressed.
New in TC9: When there are name collisions, e.g. because the rename mask leads to multiple files with the same name, or a file with that name already existed, then you get the option to auto-rename the files to "name (2).ext", "name (3).ext" etc. This will not be shown in the preview.
Field Description
Rename mask: file name
With this field, you can create a definition for a new file name. The buttons below allow to insert place holders for the previous name, parts of the name, a counter, file date/time, or a
plugin field. The + and # buttons allow to insert less used fields like the parent directory name. Place holders are always in brackets [ ], while all other letters (without brackets) will be placed in the new name without a change.
See below for a description of all available placeholders! Use Shift+Del to remove no longer wanted entries from the list.
Files can also be moved to other directories by specifying directory separators "\" (backslashes) in the name. Directories which do not exist yet will be created automatically.
Extension Definition string for extension. In principle, all placeholders can be added to either of the two definition boxes. The rename tool will create a rename string like this: Fields in name mask + "." + Fields in extension mask. The reason why the two fields are separated is to prevent the accidental removal of file extensions, which would remove the association of files with a certain program.
Search & Replace The string entered in the field 'Search for' is replaced by the string in 'Replace with'. The text in 'search for' is NOT case sensitive! Both fields support the placeholders (wildcards) * and ?. A * stands for any number of characters, a ? for exactly one character.
This function is applied AFTER the rename mask!
You can search+replace multiple strings in one step! The strings need to be separated by the vertical line (Alt+124).
Example: Replace Umlauts+Accents:
Search for: ä|ö|ü|é|è|ê|à Replace with: ae|oe|ue|e|e|e|a
^ Respect upper-/lowercase. Can be used to replace uppercase characters with other characters than lowercase.
Example: Replace Umlauts+Accents considering upper/lowercase:
Search for: ä|ö|ü|é|è|ê|à|Ä|Ö|Ü|É|È|Ê|À Replace with: ae|oe|ue|e|e|e|a|AE|OE|UE|E|E|E|A
1x Only replace the first occurrence of the search string if it appears multiple times in the file name
[E] Also replace the search text within the extension.
Rules for the case that this option is not checked:
1. When using the rename mask, only the part in "File name" will be modified by search+replace.
2. When loading the names from an external text file, the part starting with the last dot will not be modified.
Example: To replace all dots in the file name except for the one separating name and extension, uncheck this box.
Subst. Substitution: The entire file name will be replaced by the characters entered in the "Replace" field. If this option isn't checked, only the found expression will be replaced. You can work with subexpressions, see the sample in
regular expressions.
Upper/lowercase Converts the whole string to uppercase/lowercase/first letter uppercase,rest lowercase. This function is applied AFTER the rename mask and after search&replace. Use the [U], [L] and [n] placeholders to convert only certain parts of the name to upper/lowercase!
First of each word uppercase (English in Titles) excludes the following words from uppercase conversion, except at the start or end:
a,an,the,at,by,for,in,of,on,to,from,up,and,as,but,or,nor,yet,so,vs
Opens a context menu with the following options:
Load names from file: Specify a text file from which the new names should be loaded
Edit names: Save current target names to a text file, edit them, and paste back.
Configure editor: Choose a different editor to edit the files. Make sure that the editor saves as plain text!
The menu can be opened with F10.
Define counter [C] Allows you to define the counter for the [C] field(s).
Start at: Number of the first file. The files are always numbered the same way as they are shown in the result list. You can sort the result list just like in the main Total Commander window. Additionally you can reorder individual items using drag&drop, or Shift+Cursor keys.
Step by: The counter is increased/decreased by this value.
Digits: Width of the counter field. If digits is >1, the rename tool will insert leading zeros to get a fixed width number field. The option "a" automatically determines the number of digits from the number of files/folders.
F2 Load/save settings
Allows you to load or save the settings of the multi-rename tool.
<Default> Sets the default settings (no changes to the names)
Save settings
Allows you to save the current settings
Delete entry Deletes the last selected entry from the list
Entry names Loads settings saved earlier
<File list header> Allows you to sort by old names, extensions, sizes or time stamps
<File list> Shows a list of all files being renamed. The modified names are shown in the New name column. All changes to the above fields are immediately shown in this column, but the files are not actually renamed until the Start! button is pressed. If the rename mask contains an error, the string <Error!> is shown.
Individual items can be moved up/down with drag&drop or Shift+Cursor keys. This is useful for changing the file order for the counter function. You can also remove files from the list with Del if you don't want to rename them.
(next step) Loads the rename results for the next rename step. Useful if you want to apply multiple rename rules to the same set of files. Shortcut: F5.
Start! Starts to rename files. There will be a warning message if there are name conflicts.
Undo Tries to undo the rename operation in reverse order (last renamed file first). This also works AFTER closing the Multi-Rename-Tool! Just re-open it with any file(s).
Result list Creates a protocol of the renamed files.
Close Closes the dialog box without any further actions.
Here is a description of all available placeholders. IMPORTANT: Upper/lowercase is relevant!
[N] Old file name, WITHOUT extension
[N1] The first character of the original name
[N2-5] Characters 2 to 5 from the old name (totals to 4 characters). Double byte characters (e.g. Chinese, Japanese) are counted as 1 character! The first letter is accessed with '1'.
[N2,5] 5 characters starting at character 2
[N2-] All characters starting at character 2
[N02-9] Characters 2-9, fill from left with zeroes if name shorter than requested (8 in this example): "abc" -> "000000bc"
[N 2-9] Characters 2-9, fill from left with spaces if name shorter than requested (8 in this example): "abc" -> " bc"
[N-8,5] 5 characters starting at the 8-last character (counted from the end of the name)
[N-8-5] Characters from the 8th-last to the 5th-last character
[N2--5] Characters from the 2nd to the 5th-last character
[N-5-] Characters from the 5th-last character to the end of the name
[A] Old file name, WITH extension (All characters of the name), without the path
[2-5] Characters 2-5 from the name INCLUDING path and extension (other numbers as in [N] definition)
[P] Paste name of the parent directory, e.g. when renaming c:\directory\file.txt -> pastes "directory".
Also working: [P2-5], [P2,5], [P-8,5], [P-8-5] and [P2-], see description of [N] above.
[G] Grandparent directory (usage: see [P]).
[B0]..[B9] Paste a directory from the path: [B0]=[P],[B1]=[G],[B2]=great grandparent directory etc.
For partial ranges, the following syntax may be used: [B2_2-5] characters 2 to 5 from the great grandparent directory
[B+0]..[B+9]
Paste a directory from the path, starting from the left: [B+0]=drive letter, [B+1]=first directory etc.
For partial ranges, the following syntax may be used: [B+1_2-5] characters 2 to 5 from the first directory
[E] Extension
[E1-2] Characters 1-2 from the extension (same ranges as in [N] definition)
[I] Ignore dots in folder names from this point forward, so [N] contains the entire folder name, and [E] is empty (no influence on files).
If inserted again, don't ignore dots in folder names any more from that point forward.
[C] Paste counter, as defined in Define counter field
[C10+5:3] Paste counter, define counter settings directly. In this example, start at 10, step by 5, use 3 digits width.
Partial definitions like [C10] or [C+5] or [C:3] are also accepted.
Hint: The fields in Define counter will be ignored if you specify options directly in the [C] field.
[C+1/100] Fractional number: Paste counter, but increase it only every n files (in this example: every 100 files).
Can be used to move a specific number of files to a subdirectory,e.g. [C+1/100]\[N]
[Caa+1] Paste counter, define counter settings directly. In this example, start at aa, step 1 letter, use 2 digits (defined by 'aa' width)
[C:a] Paste counter, determine digits width automatically, depending on the number of files. Combinations like [C10+10:a] are also allowed.
[c1] or [c] Number of files/folders in the file list
[c2] Like [c] but with the number of digits defined in the Define counter field
[c3] The last value of the counter defined in the Define counter field
[S] Paste file size in bytes
[T1] After this position, use last modification date/time from renamed file for all date/time fields (default).
Note: These are just switches! Use them with the other time placeholders, e.g. [T1][YMD] [hms]
[T2] After this position, use current date/time (when rename dialog was opened)
[T3] After this position, use current date/time (when rename options were last changed)
[T4] After this position, use EXIF date/time for images if available, otherwise skip the file
[T1+60m] Add/remove time offset to/from date/time value: sign + or -, value, unit: s=seconds, m=minutes, h=hours, D=days, M=months, Y=years
[d] Paste date as defined in current country settings. / is replaced by a dash
[Y] Paste year in 4 digit form
[y] Paste year in 2 digit form
[M] Paste month, always 2 digit
[D] Paste day, always 2 digit
[t] Paste time, as defined in current country settings. : is replaced by a dot.
[h] Paste hours, always in 24 hour 2 digit format (0-23)
[H] Paste hours, always in 12 hour 2 digit format (1-12)
[i] am/pm indicator in English, e.g. for time format 10.30pm. Use [i1] for just a or p, e.g. 10.30p.
[m] Paste minutes, always in 2 digit format
[s] Paste seconds, always in 2 digit format
[u] Convert all composite characters (e.g. separate a and ^) to precomposed characters (â). Must be the first placeholder in the command.
[U] All characters after this position in uppercase
[L] All characters after this position in lowercase
[F] First letter of each word uppercase after this position, all others lowercase
[f] Like [F], but using rules for English in titles (certain words like a, in, the, ... lowercase)
[n] All characters after this position again as in original name (upper/lowercase unchanged)
[%x%\] Same as [%x%], but only the last part of a path (e.g. c:\temp -> temp)
[%x%_] Same as [%x%], but replace all backslashes in paths by the provided character (here: "_") and remove the ":"
[X] Paste text from clipboard. Replaces forbidden characters *?:|"<> with underscores _. The value is cached and only reloaded when the name field changes, or the user clicks on the + or # button.
[[] Insert square bracket: open
[]] Insert square bracket: close (cannot be combined with other commands inside the square bracket!)
[=pluginname.fieldname.unit]
Insert field named "fieldname" from content plugin named "pluginname". "unit" may be an optional unit (if supported by that field), or a field formatter like YMD for date fields. You can use the [=?] Plugin button to insert plugin fields.
[=pluginname.fieldname.unit:4-7]
Same as above, but for partial strings (here: letters 4-7).
Supports the same ranges as the [N] field (see above), including leading spaces or zeroes.
[="prefix"pluginname.fieldname.unit"suffix"]
The strings prefix and/or suffix will only be added when the field "fieldname" exists and has a valid value in plugin pluginname. For example, you can use this to add a measurement unit when the field is present, and nothing when the field is not present.
[=pluginname.fieldname._format]
For numeric fields: output numbers as decimal (default), hexadecimal, octal or binary.
The format string starts with an underscore and the numeric type, followed by optional parts for number groups:
Numeric type:
d=decimal
x=lowercase hexadecimal
X=uppercase hexadecimal
o=octal
b=binary
Optional grouping:
0 at start=keep leading zeroes
1 digit=group length
1 character=optional separator (default for decimal: separator from control panel, for the rest: space)
Examples: Result
[=pluginname.fieldname._x2] 01 FF AB CE
[=pluginname.fieldname._x04] 0000 0000 01FF ABCE
[=pluginname.fieldname._d3,] 1,234,567