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

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

Community Beginner ,
Nov 10, 2023 Nov 10, 2023

 

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
2.4K
Translate
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 +

...
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.pngexpand image

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.pngexpand image



Translate
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 + extension:

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

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

$1$3

 

regex.pngexpand image

Translate
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

Thanks, that worked!

Translate
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
quote

Thanks, that worked!


By Enid26229849jlhv

 

You're welcome!

Translate
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 ,
Dec 19, 2024 Dec 19, 2024

Excellent Stephen, works perfectly. Many thanks. Would you mind explaining the operators you used and what they are doing? 

Translate
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 ,
Dec 19, 2024 Dec 19, 2024
LATEST
quote

Excellent Stephen, works perfectly. Many thanks. Would you mind explaining the operators you used and what they are doing? 


By NMT

 

I posted a couple of times... Are you referring to the post marked as a correct answer?

Translate
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

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

230167.jpg

Thanks for 

Translate
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

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

 

You can add a prefix the "default" way:

2023-11-16_12-15-41.pngexpand image

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.pngexpand image



Translate
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

Thanks so much!

Translate
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