Add Character X from end

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

Add Character X from end

Postby pi3 » Thu Feb 02, 2017 4:59 pm

Hi
I’m probably being stupid, but I just can't work out how to do this.

say I've got 3 files (or hundreds) with a date added to the end, but the preceding number of characters are different.

i.e
56006_250716.jpg
3424233_250716.jpg
67465674_250716.jpg

And I want to inject a – between the dates 25-07-16.jpg

If I use Add (7) at pos. - the added char is in different places in each file as the count is from the start of the file, not the end.
How do you do this, as would think you’d need to count from the end of the filename, not the beginning.

Can this be done? Am i just missing the obvious (likley!)

Many thanks for any help

Pi3
pi3
 
Posts: 2
Joined: Thu Feb 02, 2017 4:49 pm

Re: Add Character X from end

Postby therube » Thu Feb 02, 2017 6:51 pm

Is it always _date ?
If so, you could try...

1:RegEx
Code: Select all
Match:  ^(.*)_(\d\d)(\d\d)(\d\d)$
Replace:  \1_\2-\3-\4
therube
 
Posts: 392
Joined: Mon Jan 18, 2016 6:23 pm

Re: Add Character X from end

Postby Emerkamp » Fri Feb 03, 2017 11:39 am

Hi:

I think you can also enter negative values in the "at pos" box.
Emerkamp
 
Posts: 111
Joined: Sat Aug 23, 2014 2:35 pm

Re: Add Character X from end

Postby JMM » Fri Feb 03, 2017 8:14 pm

Certainly, you can enter negative values, and BRU interprets them as 'position N chars counting from the end of the name leftwards'. So inserting something at position -6 would do something like what you want to do.
JMM
 
Posts: 29
Joined: Sat Jan 25, 2014 12:12 pm

Re: Add Character X from end

Postby pi3 » Sat Feb 04, 2017 3:51 pm

Many thanks, that works.
pi3
 
Posts: 2
Joined: Thu Feb 02, 2017 4:49 pm


Return to BRU Support