Multiple Renaming or Duplication
You can access Rename and Duplicate from the Edit menu (or the Context menu) or use the shortcuts F2 and Ctrl-D respectively.
If more than one item is currently selected, the Multiple Rename dialog will appear (or Multiple Duplicate: the only difference is its title. From now on I'll just refer to Rename).
The dialog provides three different ways to generate a new name for each item; you can use all or any of these.
Notice that the Regex section is turned off by default, and Appending/Prepending is optional. Incrementing however will always happen automatically if it's needed to prevent a name-clash.
- First on the dialog is Regular Expressions (RegEx). Put the regular expression in the box on the left, and the replacement text on the right.
So you could rename BillGates.txt as LinusTorvalds.txt simply by putting BillGates in the first box, LinusTorvalds in the second (remember that letters/digits match themselves in a RegEx).
You can of course use more complex RegEx.s too. There's a button that shows this help. However exactly what is available depends on your system e.g. backreferences may be missing.
- You can either prepend or append (or both) some text, either to the body of each original name (the bit before the last '.') or the ext (the bit after it). So you could append '.old' to every name, so that joe.txt becomes joe.txt.old.
- Finally, you can add either a digit or a letter (uppercase or lower depending on a checkbox), to either the body of each original name or the ext.
So you can change joe.txt and john.smith.txt to joe0.txt and john.smith0.txt, or joe.txtA and john.smith.txtA etc. You can also choose to add a higher number/letter instead.
Why does the dialog use the word 'incrementing' to describe this process? Suppose you were to duplicate joe.txt, but joe0.txt already exists. The potential clash will be detected, and the new file called joe1.txt instead.
And what about that 'Only if needed' checkbox? If you use one of the other methods too e.g. you prepend extra text, this prevents an unnecessary increment.
So joe.txt is changed to newjoe.txt if there isn't already a file called newjoe.txt, or to newjoe0.txt if there is.
A more realistic example: Your digital camera names each picture 0001.jpg, 0002.jpg etc. You've stored 100 of these pictures in a directory, and you'd like to rename them '2007 Holiday 1.jpg', '2007 Holiday 2.jpg' etc.
Select all the pictures and press F2 to get the dialog. Click the 'Use a Regular Expression' tickbox. In the 'Replace' box put [[:digit:]]*.jpg and in the 'With' box 2007 Holiday .jpg. Then set the 'Increment starting with' control to '1' (unless you want the first picture to be number 0) and untick 'Only if needed' (otherwise the first picture will be unnumbered).
Click OK and a 'Confirm' dialog will appear, showing the old and new names. This gives you a chance to try again if it wasn't just as you wanted, as well as OK and Cancel.
What is happening? First the RegEx renames all the pictures '2007 Holiday .jpg'. The Increment section then adds a number from 1 to 100 between the second space and the '.' to make the name unique. (Yes, I know there are other ways to have done this, but this one is easy to understand.)