I had an interesting email from someone who uses my Search and Replace plug-in for Lightroom:
… I need to remove text (“Scan_”) from the filename for images I scanned 4-5 years ago (and are now in my LR catalog). It appears Search and Replace does not work on filenames, only on metadata. Pre-LR catalog I used a utility to do bulk file name changes on folders of files, but that will be a problem with the LR catalog. I could use the bulk filename changing tool, then delete the LR-cataloged-but-missing-image and then reimport the newly rename files.
But it seems risky and I’d lose metadata for the images w/o XMP files.
Replacing text in filenames is quite a common need, and for example Adobe Bridge’s renaming dialog box allows it with its “string substitution” option – see the bottom of this article.
But this capability has never been available in Lightroom.
I suspect the explanation is simply that “string substitution” was added to Bridge during Lightroom’s early days and was simply overlooked when LR’s batch rename feature was being designed. And sadly, this omission has never been rectified, even 13 years after I started whining to Adobe about it….
So, somewhat wearily, I began composing my reply by stating that Search & Replace couldn’t help with file renaming, and that was because Adobe don’t allow plugins to rename photos. In other words, “computer says no“!
But all of a sudden, the solution revealed itself and it’s a lot simpler than I’d thought.
The method
- Use Search & Replace’s Transfer command to copy the file name (or “file name without extension” might be a better choice) into a field which Lightroom’s built-in Batch Rename dialog will be able to use. I suggest Headline as it’s rarely used nowadays:
- Use Search & Replace’s Replace tab to remove the text, in this case “Scan_”, from the field that now contains the copied file names.
– Remember that searches are case-sensitive.
– Depending on your file names, you may have to do this more than once, replacing “Scan” with nothing and then removing or replacing some other word or characters.
- Finally use LR’s Rename Photos command to rename the files using the field in the renaming template. Here I’ve chosen Headline and the example shows how the file names will be changed:
The whole process is a lot easier than I ever imagined. As always with this kind of task, try it with a few photos first before using it to rename lots of files.
“String Substitution” in Bridge
Warning: I do not recommend this method as it removes any Lightroom pick flags, stacking, VCs, collections, history steps already applied to the files:
- In Lightroom, save the metadata back to the files – Ctrl or Cmd S
- In Bridge, select the files and use Batch Rename
- In its New Filenames section, select the option String Substitution
- Next line down is where you choose what to find and what to replace it with
- In Lightroom, synchronize the folder – this will remove the -Edit files and import the renamed versions