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

Batch rename images with consecutive numbering into middle of filenames

Community Beginner ,
Feb 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied

Hi all,

 

I'm wondering if it's possible for batch rename to implement consecutive numbering into the MIDDLE of a filename.  In the attached example, I want to replace the  .1's  with .1, .2., .3 etc but keep everything else identical. 

 

Would appreciate any instructions, as hard to figure it out within the batch rename function....

Capture.PNG

 

TOPICS
Batch , How to

Views

131

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 28, 2024 Feb 28, 2024

@John34902474s7aw 

 

A 2-step approach as the original 1-step intermediate filename method was giving me problems, the preview didn't match the results!

 

Work on file copies until you know that this gives you the expected result!

 

STEP 1:

2024-02-28_22-39-22 (1).png

 

STEP 2:

2024-02-28_22-53-59 (1).png

 

Find:

(^0+)(\d+)(\w+\.\w+\.)(\d)(.+)(\.[^\.]+$)

 

Replace (Use Regular Expression):

$3$2$5$6

 

The final result:

FM.L1522.1_Result-7
FM.L1522.2_Result-8
FM.L1522.3_Result-9
FM.L1522.4_Result-10
FM.L1522.5_Result-11

Votes

Translate

Translate
Community Expert ,
Feb 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied

@John34902474s7aw 

 

Yes, this is possible, set this up as per this screenshot:

 

<SOLUTION BEING REWORKED>

 

 

 

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 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied

Thanks - not displaying the screenshot though. Possible to retry?

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 ,
Feb 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied


@John34902474s7aw wrote:

Thanks - not displaying the screenshot though. Possible to retry?


 

I had to remove the original suggestion as it had unforeseen errors.

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 ,
Feb 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied

@John34902474s7aw 

 

A 2-step approach as the original 1-step intermediate filename method was giving me problems, the preview didn't match the results!

 

Work on file copies until you know that this gives you the expected result!

 

STEP 1:

2024-02-28_22-39-22 (1).png

 

STEP 2:

2024-02-28_22-53-59 (1).png

 

Find:

(^0+)(\d+)(\w+\.\w+\.)(\d)(.+)(\.[^\.]+$)

 

Replace (Use Regular Expression):

$3$2$5$6

 

The final result:

FM.L1522.1_Result-7
FM.L1522.2_Result-8
FM.L1522.3_Result-9
FM.L1522.4_Result-10
FM.L1522.5_Result-11

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 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied

Thanks - 

Not experienced with this coding business, so a question - 

 

Would the content in step 2 remain the same whether renumbering small groups of e.g. 5 images, or large groups of e.g. 50 images in this way?   I.e. could I save this as a preset, and use it for different sized groups of images in future? 

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 ,
Feb 28, 2024 Feb 28, 2024

Copy link to clipboard

Copied

quote

Thanks - 

Not experienced with this coding business, so a question - 

 

Would the content in step 2 remain the same whether renumbering small groups of e.g. 5 images, or large groups of e.g. 50 images in this way?   I.e. could I save this as a preset, and use it for different sized groups of images in future? 


By @John34902474s7aw

 

It should... I tried to make it robust and flexible, however, I only tested on 5 images.

 

Work on duped copies until you know, just in case.

 

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 ,
Feb 29, 2024 Feb 29, 2024

Copy link to clipboard

Copied

LATEST

@John34902474s7aw – how did you go with my solution?

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