Can autonumber be made to reset when certain text differs?

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Can autonumber be made to reset when certain text differs?

Postby Rairhorns » Tue Sep 27, 2016 1:49 pm

Hi,
I'm fairly new to Bulk Rename, but i've been working my way though the forum trying to come up with something a little complicated. In short, i need to add an incrementing autonumber after a hyphen, which resets when the text before it changes. For example:

Currently my files look like this:
    BRUIEW-intro1
    BRUIEW-intro2
    BRUIEW-example1
    BRUIEW-example2
    BRUIWXXY-intro1
    BRUIWXXY-example1
    BRUIWXXY-example2
    BRUIWXXY-example3
    BRUIWXXY-example4

But they need to look like this:
    BRUIEW-01-intro1
    BRUIEW-02-intro2
    BRUIEW-03-example1
    BRUIEW-04-example2
    BRUIWXXY-01-intro1
    BRUIWXXY-02-example1
    BRUIWXXY-03-example2
    BRUIWXXY-04-example3
    BRUIWXXY-05-example4

It's been puzzling me for some time, and i've got many thousands of files that'll need renaming in this way.
Any ideas would be great!
Rairhorns
 
Posts: 1
Joined: Tue Sep 27, 2016 1:30 pm

Re: Can autonumber be made to reset when certain text differs?

Postby KenP » Thu Sep 29, 2016 5:49 pm

Try this.

Numbering (10)
Mode: Suffix
Start: 1
Pad: 2
Sep: -
Break: 5

Rename
Reset

The file names should now have the numbers appended at the end of the file name, e.g. BRUIEW-intro1-01.

To move the added numbers to the correct position.
RegEx (1)
Match: (.*)(-)(.*)(-)(.*)
Replace: \1-\5-\3

The "Break" Option in the Numbering section (10) allows you to reset the numbering when a character changes, for instance in your example the 5th character is the first to change so setting "Break" at 5 resets the numbering at that point.
KenP
 
Posts: 198
Joined: Sat Jul 30, 2016 11:25 am

Re: Can autonumber be made to reset when certain text differs?

Postby Admin » Sat Oct 01, 2016 3:07 am

Also using Javascript renaming you can do this in one pass and it can get as complex as you need.
Admin
Site Admin
 
Posts: 1502
Joined: Tue Mar 08, 2005 8:39 pm


Return to BRU Support