Need to rename a group of files but only the last part

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

Need to rename a group of files but only the last part

Postby dbonilla » Tue May 30, 2017 9:37 pm

This is a really good utility, keep the good work. :lol:

Need to rename a group of files but only the last part, we Ran a backup utility and the backup instead of replacing the file just create the same name file but add the _1 at the end.

for example file name: company_date_110854_data.doc it created a new file in the same folder named: company_date_110854_data_1.doc, what i want to do is only replace the _1 at the end only, if you notice the file also in the middle of the name has the date that start with _1, i dont want to change that, when i use this settings(check screenshot here:http://prntscr.com/fdz4zi) it is replacing also the Date part, i just only want to change the last part of the file.

it is posible to do that.

thanks in advance
dbonilla
 
Posts: 3
Joined: Tue May 30, 2017 9:29 pm

Re: Need to rename a group of files but only the last part

Postby KenP » Tue May 30, 2017 10:15 pm

This will remove any _1 that's immediately before the file extension.

RegEx (1)
Match: (.*)_[1]$
Replace: \1
KenP
 
Posts: 193
Joined: Sat Jul 30, 2016 11:25 am

Re: Need to rename a group of files but only the last part

Postby dbonilla » Tue May 30, 2017 10:43 pm

KenP wrote:This will remove any _1 that's immediately before the file extension.

RegEx (1)
Match: (.*)_[1]$
Replace: \1



Thanks for the quick reply, it works but eventhough im using the "prevent Duplicates" and "overwrite / delete exisiting files" option still keeping the same duplicate file i would like to overwrite to keep only one.

Thanks
dbonilla
 
Posts: 3
Joined: Tue May 30, 2017 9:29 pm

Re: Need to rename a group of files but only the last part

Postby dbonilla » Wed May 31, 2017 4:23 am

I see it is taking the _1 at the end but the issue is that is adding a space at the beginning i would like to keep the same name so i can overwrite the other file and only keep one file.

any advise?
dbonilla
 
Posts: 3
Joined: Tue May 30, 2017 9:29 pm

Re: Need to rename a group of files but only the last part

Postby KenP » Wed May 31, 2017 9:55 am

Sorry I couldn't get back to this earlier.

The regex I posted doesn't add a space at the start of the file-name, the issue with that is almost certainly that you've left a space before \1 in the replace box.

The Match box should be (.*)_[1]$ with no spaces before or after what I've coloured blue.
The Replace box should be \1 with no spaces before or after what I've coloured blue.
KenP
 
Posts: 193
Joined: Sat Jul 30, 2016 11:25 am


Return to BRU Support