Rename only last part of filenames

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

Rename only last part of filenames

Postby JENNINGSSSMITH » Mon Nov 04, 2013 6:54 pm

hi, I have been trying to figure out how to rename only the last portion of a filename. For example-
Current-
10506B-206-2.jpg

New-
10506B-206.jpg

I deal with many photo files that need to be edited like this. I bet there is a way, I just can't seem to figure it out.
JENNINGSSSMITH
 
Posts: 4
Joined: Mon Nov 04, 2013 6:36 pm

REMOVE last part of filenames

Postby Stefan » Tue Nov 05, 2013 7:18 am

How about this


FROM:
10506B-206XX.jpg
TO:
10506B-206.jpg

USE:
Remove(5)
Last n [ 2]




?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Rename only last part of filenames

Postby JENNINGSSSMITH » Tue Nov 05, 2013 3:55 pm

Hey, thanks for replying. You know I forgot to put in my example, What I actually need is for my file names to look something like this-

10506B-206-2.JPG

I need to change it to this-

10506B-206_1.JPG

My files have to be changed to this format in order for my web server to recognise them, but I couldn't figure out how to get just the last portion to change. I appreciate any help! Thanks
JENNINGSSSMITH
 
Posts: 4
Joined: Mon Nov 04, 2013 6:36 pm

Replace last part of filename

Postby truth » Tue Nov 05, 2013 5:28 pm

Heres a 1Regex solution to match filenames ending as -#
(.+)-(\d)$
\1_\2

If you also need to match filenames ending as -####
(.+)-(\d+)$
\1_\2
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Re: Rename only last part of filenames

Postby JENNINGSSSMITH » Tue Nov 05, 2013 6:03 pm

Hey, thanks for responding. Sorry, i'm still learning BRU. So do I need to type this in the RegEx boxes?

Match -2.JPG(.+)-(\d)$
Replace _2.jpg\1_\2

do I check the box?

or is there something else I should be doing?

Thanks for your help
JENNINGSSSMITH
 
Posts: 4
Joined: Mon Nov 04, 2013 6:36 pm

Replace last part of filename

Postby truth » Tue Nov 05, 2013 6:49 pm

The #1Regex Boxes (Match & Replace) should have:
(.+)-(\d)$
\1_\2

No other text should be input, the small box beside R should be checked
From there, you can select filenames to preview potential newnames

Note this example wont touch filenames ending with more than 1#
If you wish to do so, use the other Match/Replace example in previous post
Post back if you're curious as to how this matches/groups/replaces filename chars
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Re: Rename only last part of filenames

Postby JENNINGSSSMITH » Tue Nov 05, 2013 8:39 pm

Thanks! That worked out great!
JENNINGSSSMITH
 
Posts: 4
Joined: Mon Nov 04, 2013 6:36 pm


Return to BRU Support


cron