Batch Renaming

You can rename many files and directories in a batch using specified rules.

To batch rename:

  1. Select the files and directories you want to rename.
  2. Open the Batch Rename dialog box:
    Menu:Plugins/Renamer/Batch Rename...
    Shortcut key:Ctrl+Shift+R
  3. Specify rules for renaming. See examples below.
  4. Click the Rename button.

Examples

You can find here examples of typical use of the Renamer plugin. Description of all options is in the Batch Rename dialog box.

Using a counter
Adding a prefix to all names
Replacing a word in all names
Removing spaces from all names
Reordering words in names
Using structured name to create directory structure
Moving all files from subdirectories into one directory
Removing only periods that are not surrounded by digits

Using a counter

Lets say we have files P1020652.JPG, P1020653.JPG, and P1020654.JPG. And we want to rename them to House1.jpg, House2.jpg, and House3.jpg.

  1. Select our three files (P1020652.JPG, P1020653.JPG, and P1020654.JPG) in panel.
  2. Open the Batch Rename dialog box.
  3. Go to the New name combo box and type word "House" here.
  4. Click the button next to the New name combo box.
  5. Choose Counter from the context menu. It opens the Add Counter dialog.
  6. Type "1" to the Start at edit box.
  7. Choose the OK button.
  8. Counter has been added. Value in the New name combo box is "House$(Counter:1)".
  9. Go to the New name combo box and add ".jpg" to the end of text.
  10. Now you should see House1.jpg, House2.jpg, and House3.jpg in the Preview listview in the New Name column.
  11. Choose the Rename button.

Adding a prefix to all names

Lets say we have files House1.jpg, House2.jpg, and House3.jpg. And we want to rename them to NewHouse1.jpg, NewHouse2.jpg, and NewHouse3.jpg.

  1. Select our three files in panel.
  2. Open the Batch Rename dialog box.
  3. Go to the New name combo box and type word "New" here.
  4. Click the button next to the New name combo box.
  5. Choose Original Name from the context menu.
  6. Value in the New name combo box is "New$(OriginalName)".
  7. Now you should see NewHouse1.jpg, NewHouse2.jpg, and NewHouse3.jpg in the Preview listview in the New Name column.
  8. Choose the Rename button.

Replacing a word in all names

Lets say we have files NewHouse1.jpg, NewHouse2.jpg, and NewHouse3.jpg. And we want to rename them to New Car 1.jpg, New Car 2.jpg, and New Car 3.jpg.

  1. Select our three files in panel.
  2. Open the Batch Rename dialog box.
  3. Go to the Search for combo box and type word "House" here.
  4. Go to the Replace with combo box and type word " Car " here.
  5. Now you should see New Car 1.jpg, New Car 2.jpg, and New Car 3.jpg in the Preview listview in the New Name column.
  6. Choose the Rename button.

Removing spaces from all names

Lets say we have files New Car 1.jpg, New Car 2.jpg, and New Car 3.jpg. And we want to rename them to NewCar1.jpg, NewCar2.jpg, and NewCar3.jpg.

  1. Select our three files in panel.
  2. Open the Batch Rename dialog box.
  3. Go to the Search for combo box and type one space character here.
  4. Clear the Only once in each name check box.
  5. Now you should see NewCar1.jpg, NewCar2.jpg, and NewCar3.jpg in the Preview listview in the New Name column.
  6. Choose the Rename button.

Reordering words in names

Lets say we have files The Beatles - Yellow Submarine - Revolver.mp3, The Beatles - Michelle - Rubber Soul.mp3, and The Beatles - Yesterday - Help!.mp3 and we want to swap an album name (third part of the name) for a track name (second part of the name). So we want to rename them to The Beatles - Revolver - Yellow Submarine.mp3, The Beatles - Rubber Soul - Michelle.mp3, and The Beatles - Help! - Yesterday.mp3.

  1. Select our three files in panel.
  2. Open the Batch Rename dialog box.
  3. Select the Regular expression check box.
  4. Select the Exclude extension check box.
  5. Go to the Search for combo box and type "(.*) - (.*) - (.*)" here. This regular expression contains: ".*" (any character repeated zero or more times), "()" (each subexpression is enclosed in parenthesis), " - " (just a substring used as a delimiter in filenames). Meaning of this expression is: find three substrings delimited by " - ".
  6. Go to the Replace with combo box and type "$1 - $3 - $2" here. This expression contains: "$1", "$2", and "$3" (the first, second, and third matched subexpressions), and " - " (again just a substring used as a delimiter in filenames).
  7. Now you should see The Beatles - Revolver - Yellow Submarine.mp3, The Beatles - Rubber Soul - Michelle.mp3, and The Beatles - Help! - Yesterday.mp3 in the Preview listview in the New Name column.
  8. Choose the Rename button.

Using structured name to create directory structure

Lets say we have files The Beatles - Revolver - Yellow Submarine.mp3, The Beatles - Rubber Soul - Michelle.mp3, and The Beatles - Help! - Yesterday.mp3. We want to create directory The Beatles with subdirectories Revolver, Rubber Soul, and Help!, and move MP3 files to these subdirectories only with the last part of name (a track name).

  1. Select our three files in panel.
  2. Open the Batch Rename dialog box.
  3. Choose the Rename Relative Path option from the Options menu.
  4. Clear the Only once in each name check box.
  5. Go to the Search for combo box and type " - " here.
  6. Go to the Replace with combo box and type "\" here.
  7. Now you should see The Beatles\Revolver\Yellow Submarine.mp3, The Beatles\Rubber Soul\Michelle.mp3, and The Beatles\Help!\Yesterday.mp3 in the Preview listview in the New Name column.
  8. Choose the Rename button.

Moving all files from subdirectories into one directory

Lets say we have two directories Car and House, and four files Car\1.jpg, Car\2.jpg, House\3.jpg, and House\4.jpg (two files in each directory). We want to move them to one directory Photos, so we want to rename them to Photos\1.jpg, Photos\2.jpg, Photos\3.jpg, and Photos\4.jpg.

  1. Select directories Car and House in panel.
  2. Open the Batch Rename dialog box.
  3. Select the Include subdirectories check box.
  4. Choose the Rename Relative Path option from the Options menu.
  5. Choose the Remove Emptied Directories option from the Options menu.
  6. Select the Regular expression check box.
  7. Go to the Search for combo box and type ".*\\" here. This regular expression contains: ".*" (any character repeated zero or more times) and "\\" (a backslash character). Meaning of this expression is: find the longest substring ending with a backslash.
  8. Go to the Replace with combo box and type "Photos\" here.
  9. Now you should see Photos\1.jpg, Photos\2.jpg, Photos\3.jpg, and Photos\4.jpg in the Preview listview in the New Name column.
  10. Choose the Rename button.

Removing only periods that are not surrounded by digits

Lets say we have directories Altap.Salamand.2.5 and Altap.Salamand.2.0. We want to rename them to Altap Salamand 2.5 and Altap Salamand 2.0.

  1. Select our two directories in panel.
  2. Open the Batch Rename dialog box.
  3. Select the Regular expression check box.
  4. Clear the Only once in each name check box.
  5. Go to the Search for combo box and type "(?<=\D)\.|\.(?=\D)" here. This regular expression contains: "(?<=\D)" (positive look behind for non-digit character ("\D")), "\." (a period character), "|" (delimits two alternative expressions), and "(?=\D)" (positive look ahead for non-digit character ("\D")). Meaning of this expression is: find a period character which is preceded or followed by a non-digit character.
  6. Go to the Replace with combo box and type one space character here.
  7. Now you should see Altap Salamand 2.5 and Altap Salamand 2.0 in the Preview listview in the New Name column.
  8. Choose the Rename button.

See Also

Batch Rename dialog box