• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Wildcard search for Batch file rename - is it possible?

New Here ,
Feb 06, 2017 Feb 06, 2017

Copy link to clipboard

Copied

Hi everyone

I'm trying to use Batch File Rename in Adobe Bridge to strip out characters left behind by the photographic stage.

eg.

F1 IDO60-BLK.jpg

F2 IDO80-GRY.jpg

I want to search with a wildcard to eliminate the F1, F2 etc and space and leave the IDO60... etc intact

Is this possible? I tried using F* but it doesn't work.

Cheers

Views

4.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 06, 2017 Feb 06, 2017

Hi martinl47003580, you need to use a regular expression based string substitution search/replace:

Find: ^\w*\d*\s

Replace: (blank)

The above regex will look for zero or more letters and zero or more numbers and then a single space at the beginning of the filename.

I have tried to make this expression a little more versatile/robust than your sample filenames which could have used a very simple/explicit expression:

F\d\s or ^F\d\s

However what if you ever had files that started with a different charac

...

Votes

Translate

Translate
Community Expert ,
Feb 06, 2017 Feb 06, 2017

Copy link to clipboard

Copied

Hi martinl47003580, you need to use a regular expression based string substitution search/replace:

Find: ^\w*\d*\s

Replace: (blank)

The above regex will look for zero or more letters and zero or more numbers and then a single space at the beginning of the filename.

I have tried to make this expression a little more versatile/robust than your sample filenames which could have used a very simple/explicit expression:

F\d\s or ^F\d\s

However what if you ever had files that started with a different character than an uppercase F? Or what if you ever had two or more digits following the letter before the space? This is why I went with a more flexible/robust expression.

regex.png

It is usually a good idea to tick the “Preserve current filename in XMP Metadata” when batch renaming, so that you can easily recover the original filenames if required.

EDIT: Looking at this a second time, an equivalent result and perhaps “technically better” would also be achieved with ^\w[0-9]+\s or how about ^\w+\d+\s or perhaps even ^\w+?\d+?\s etc. This is the great thing about regex, there are many ways to get to the same result (some verbose, some more elegant) – it all depends upon the context/use and how flexible the pattern recognition needs to be! Some other variations could be F.+?\s or ^.+?\s

P.S. You can save this search/replace as a preset using the save button at the top of the interface.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 14, 2017 Feb 14, 2017

Copy link to clipboard

Copied

Thanks Stephen. Very helpful. I ran a few batches using your search string and it worked perfectly.

Regards,

Martin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

Thanks for this, really useful

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

LATEST

You can find a hugely useful reference at Regular-Expressions.info - Regex Tutorial, Examples and Reference - Regexp Patterns

Keep in mind that different programs implement regex in slightly different way6s, but the core workings are pretty standard.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines