Rename many files at once aka bulk rename

Photography Jobs Online

Learn Digital Photography Now

Get Instant Access

Have you ever been out with your digital camera and then returned home to find yourself with lots of files with names like IMG_0159.jpg, IMG_0160.jpg, IMG_0161 .jpg, and so on? And have you then gone through one-by-one renaming them with something relevant? Well, there's no need to ever do that again because Ubuntu can come to the rescue!

There are a handful of ways of bulk renaming files at the command-line but many are quite involved and you'll need to remember a chain of commands. To save the effort, use Synaptic to install purrr (that's pu, followed by three "r"s!). This is a GUI application that allows simple bulk renaming. once installed, you'll find the program on the Applications ^ Accessories folder.

1. Start by clicking and dragging the files from a Nautilus window onto the Files section of Purrr. If you intend to bulk rename the files with sequentially increasing numbers, it's important to first sort them into the right order before dragging across—possibly the best way of doing this is to click View ^ View as List in Nautilus, and then click the Date Modified heading to sort by the time the files were created (this is ideal for digital photographs). Alternatively, you might click the Name heading if the filenames can be sorted alphanumerically. Then [Shi ft +click to highlight many files at once and drag them into the Purrr window.

2. In the Name template text field, you need to type the basic format of the new filenames. For example, if the pictures were all taken at Disneyland, you might type that. You'll see the effect on the new filenames as you type, although they won't actually be renamed until you hit the Rename button.

3. There are a handful of useful special inserts you can make into the filename. Typing [N] causes the original filename to be added to the renamed files, while [C] adds a sequential number count. [E] causes the file extension to appear (necessary if [N] isn't used).

Here's an example. The following, when typed into the Name template box, will cause all the files to be named Disneyland, followed by a sequentially increasing number, and then followed by the original file extension:

Try it to see what happens. The [C] (count) operator can be further configured. A single comma inserted after C, followed by a number, sets the start number for the count. For example, [C,400] will start the count at 400. See Figure 3.38, on the next page for an example from my test Pc. Two commas causes the count to skip numbers as it counts upward. For example, [C„4] will name the first file with 1, the second with 5, the third with 9, the fourth with 13, and so on. In other words, +4 each time.

File Help Name template: Files

File Help Name template: Files

Old name

New name

IMGQ1443

pg

afr Disneyland 400.E

IMG01444

P9

^ Disneyland 401,E

IMG01445

pg

Disneyland 402,E

IMGQ1446

pg

Disneyland 403,E

IMG01447

pg

afc Disneyland 404,E

IMG01448

pg

^ Disneyland 405,E

IMG01449

pg

a^ Disneyland 406,E

IMG01450

pg

^ Disneyland 407,E

IMGQ1451

pg

^ Disneyland 408.E

IMG01452

pg

^ Disneyland 409,E

IMG01453

pg

Disneyland 410,E

IMGQ1454

pg

^ Disneyland 411,E

IMGmdSS

nn

nknPvlanH ill 7 F

Exclude files Qrtslp

Exclude files Qrtslp

Qsjb

Figure 3.38: Bulk renaming files using Purrr (see Tip 230, on page 270)

Three commas causes the count to be "padded" with zeros, and the number of zeros is specified by the number that follows. [C„,3] will cause the count to start at 001, then 002, then 003, and so on. When the count reaches double or triple figures, the padding zeroes will disappear (ie disneyland_009.jpg, disneyland_010.jpg ... dis-neyland_099.jpg, disneyland_100.jpg and so on).

4. Once you've typed your selection, hit the Rename button to carry-out the renaming.

Was this article helpful?

0 0
Digital Photography Mastery

Digital Photography Mastery

Insider Secrets Revealed By the Pro Showing You How to Become a Professional Photographer! Discover The Secret Tips & Techniques On How To Be A Professional Photographer, Start Producing High Quality Pictures and Skyrocket Your Photography Business Income Revenue To The Roof TODAY! You're About to Discover the Powerful Strategies and Method to Start Taking Sharp, Clear and High Quality Pictures Like the Professional Photographer Without Paying a Single Penny to the Expert!

Get My Free Ebook


Post a comment