Incrementing number for duplicate files

Advanced Renamer forum
#1 : 17/12-20 19:40
Philipp Kirchenmayer
Philipp Kirchenmayer
Posts: 1
Is there a way to have an incremental number increase per duplicate file, if there any, while just adding a fixed number to unique files?

Example:

AAA.jpg
BBB.jpg
CCC.jpg
CCC.jpg
CCC.jpg

Desired result:

AAA_1.jpg
BBB_1.jpg
CCC_1.jpg
CCC_2.jpg
CCC_3.jpg

I'm aware of the collusion setting, but it only applies the number for duplicate files.


17/12-20 19:40
#2 : 17/12-20 21:10
David Lee
David Lee
Posts: 600
You will need to do this in two stages...

First: renumber the duplicates as normal, using the Name collision rule "Append number" with Separator = "_".

This will return...
AAA.jpg
BBB.jpg
CCC_001.jpg
CCC_001.jpg
CCC_003.jpg

Second:
In a separate batch use a regular expression to match filenames without a suffix and add "_1"...
Replace: "(^[^_]*$)"
With: "\1_1"
Use regular expressions

and (in the same batch) add a Renumber method to remove existing zero padding...
Number position = "1"
Change to: "Relative to existing number"
Number difference: "0"
Zero padding = "Manual"
Number length = "0"





17/12-20 21:10 - edited 17/12-20 21:11