Skip to main content
Participant
September 18, 2024
Answered

Batch rename using String Substitution in Bridge

  • September 18, 2024
  • 2 replies
  • 562 views

I need to rename a folder full of images. Current file naming convention is Last_First_MonthYear.jpg and I need the file names to drop the _MonthYear and leave only Last_First.jpg.

For example:

Smith_John_Oct2024.jpg would become

Smith_John.jpg

This topic has been closed for replies.
Correct answer Stephen Marsh

There are multiple viable regular expressions:

 

Find:

(^.+)(_.+)

Replace:

$1

 

or

 

Find:

_[^_]*$

Replace:

 

or

 

Find:

_(?<=_)[^_]+$

Replace:

 

 

2 replies

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
September 20, 2024

There are multiple viable regular expressions:

 

Find:

(^.+)(_.+)

Replace:

$1

 

or

 

Find:

_[^_]*$

Replace:

 

or

 

Find:

_(?<=_)[^_]+$

Replace:

 

 

Participant
September 20, 2024

That did the trick! Thank you, @Stephen Marsh.

Stephen Marsh
Community Expert
Community Expert
September 20, 2024
quote

That did the trick! Thank you, @Stephen Marsh.


By @ma406771_9058

 

You're welcome!

Legend
September 19, 2024

If the pattern is the same for all files, you can use a regular expression (regex) for this.

https://www.regular-expressions.info/quickstart.html

 

Participant
September 20, 2024

Thank you for that resource, @Lumigraphics. It will be immensely useful.