Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When you come across a directory of files that need to be renamed in some uniform way, it can be tedious and time-consuming to rename each file individually. Manual renaming is error prone, and in the case of medium to large directories it's much slower than scripting the process. This guide explains the principles of renaming batches of files using Adobe Bridge, the Windows command prompt, and Python. Each method has strengths and weaknesses, and the right tool for a given job is typically whichever one you're most comfortable with. The goal with this kind of work is to reduce stress, not to increase it!

Table of Contents

Adobe Bridge

Bridge is a free asset management tool released by Adobe that plugs in very nicely to various Adobe creative suite products. It has some useful tools that don't rely on any other software, too, such as the Batch Rename tool. On a surface level, Bridge works somewhat like Windows Explorer or Finder on OS X. You can navigate the same drives and folders you ordinarily see on your computer.

...

Before you click "Rename", it's important to click "Preview" and look over the list of changes that will be made, to make sure file sequences are correctly preserved in the new naming template. If the order of files changes as a result of bulk renaming, it is exceptionally difficult to undo the change and fix the order. It's important to be sure before committing the change. It's also a very good idea to select the "Export to CSV" button in the Preview window, to save a record of the change. That CSV can be quickly manipulated into a txt file and saved as a readme.

Windows command prompt

Simple changes

For relatively quick and straightforward renaming tasks, the command prompt can be handy. The command prompt is less suited to inserting filename elements in the middle of a filename, or to adding sequence numbers, but if you need to add an element to the beginning or end of a set of files, it can do the job very quickly.

...

In this example the original file name is added to but not manipulated in any more advanced way. To do more advanced transformations, you're better off using Bridge or Python.

Renaming using a spreadsheet

Another way of renaming files with the command line involves using a two-column CSV file. Each row of the CSV will list an original filename in the first column and the preferred ("target") filename in the second column. You can use the command prompt to find the file listed in the first column and change its name to the target value in the second column.

...

*The first part of the command only explicitly assigns the variable name "%a" to the first column and provides no variable name for the second column. The system will automatically assign the next alphabetical character (%b, in this case) to the second column, and only the first column's variable letter needs to be provided.

Python

For more complicated jobs, you can write a simple script in Python that will parse a file list and manipulate each item. You will need to install a Python 3 code editor (I use Spyder, installed as part of Anaconda) to write and execute your script.

...