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

How to remove characters in file name using batch rename in Bridge

Community Beginner ,
Nov 10, 2023 Nov 10, 2023

Copy link to clipboard

Copied

 

I have a series of files that are like: 230167 firstname lastname.jpg
I would like to remove everything but the first 6 digits of the file name so that I'm left with 230167.jpg

Thanks

Enid

 

TOPICS
Batch , How to

Views

613

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 2 Correct answers

Community Expert , Nov 11, 2023 Nov 11, 2023

@Enid26229849jlhv – try the following:

 

Find using Regular Expression capture groups – starting with only 6 digits from the left + extension:

(^\d{6})(.+)(\.[^\.]+$)

Replace (using back-references to the capture groups):

$1$3

 

or

 

Find using Regular Expression capture groups – first 6 digits or characters from the left + extension:

(^.{6})(.+)(\.[^\.]+$)

Replace (using back-references to the capture groups):

$1$3

 

or

 

Find using Regular Expression capture groups – first word from the left +

...

Votes

Translate

Translate
Community Expert , Nov 16, 2023 Nov 16, 2023

A copy/paste from my reply to your PM...

 

You can add a prefix the "default" way:

2023-11-16_12-15-41.png

Or the alternative is what Adobe call "String Substitution" (find/replace with a regular expression option):

Find (start/far left of the text string):
^
Replace (P + space):
P

2023-11-16_12-17-27.png



Votes

Translate

Translate
Community Expert ,
Nov 11, 2023 Nov 11, 2023

Copy link to clipboard

Copied

@Enid26229849jlhv – try the following:

 

Find using Regular Expression capture groups – starting with only 6 digits from the left + extension:

(^\d{6})(.+)(\.[^\.]+$)

Replace (using back-references to the capture groups):

$1$3

 

or

 

Find using Regular Expression capture groups – first 6 digits or characters from the left + extension:

(^.{6})(.+)(\.[^\.]+$)

Replace (using back-references to the capture groups):

$1$3

 

or

 

Find using Regular Expression capture groups – first word from the left + extension:

(^.+?\b)(.+)(\.[^\.]+$)

Replace (using back-references to the capture groups):

$1$3

 

regex.png

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 ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

Thanks, that worked!

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 Expert ,
Nov 13, 2023 Nov 13, 2023

Copy link to clipboard

Copied

quote

Thanks, that worked!


By @Enid26229849jlhv

 

You're welcome!

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 ,
Nov 16, 2023 Nov 16, 2023

Copy link to clipboard

Copied

Another question! I would like to add P to a file name. Example:

230167.jpg

Thanks for 

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 Expert ,
Nov 16, 2023 Nov 16, 2023

Copy link to clipboard

Copied

A copy/paste from my reply to your PM...

 

You can add a prefix the "default" way:

2023-11-16_12-15-41.png

Or the alternative is what Adobe call "String Substitution" (find/replace with a regular expression option):

Find (start/far left of the text string):
^
Replace (P + space):
P

2023-11-16_12-17-27.png



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 ,
Nov 17, 2023 Nov 17, 2023

Copy link to clipboard

Copied

LATEST

Thanks so much!

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