Removing dirname numbers

Advanced Renamer forum
#1 : 20/09-19 06:53
nath
nath
Posts: 2
Hello.

I'm having some trouble renaming files within a large number of dirs.

<DirName:1>-<Inc NrDir:1>

... is doing what I need it to EXCEPT when the DirName is numbered.

For example, a directory called:

this-is-a-test-20

... renames files to :

this-is-a-test-20-01.jpg
this-is-a-test-20-02.jpg
this-is-a-test-20-03.jpg
etc

... where as what I want is:

this-is-a-test-01.jpg
this-is-a-test-02.jpg
this-is-a-test-03.jpg

Any ideas?

Thank you!


20/09-19 06:53
#2 : 20/09-19 10:13
David Lee
David Lee
Posts: 1125
Easiest way will be to carry this out in three steps...

1. Rename all files to the directory name
2. Strip numbers from ends of filenames
3. Append incrementing numbers

1. New Name method...
New Name: <DirName:1>

2. Remove Pattern method...
Pattern: -\d\d$
Select "Use regular expressions"

3. Add method...
Add: -<Inc NrDir:01>
At index: 0
Select "Backwards"


20/09-19 10:13
#3 : 23/09-19 12:24
nath
nath
Posts: 2
Reply to #2:
That did it!

Thank you :-)


23/09-19 12:24