Multiple replace

A swapping-ground for Regular Expression syntax

Multiple replace

Postby chris » Tue Mar 23, 2010 11:23 am

Hi,

I regularly find myself needing to run BRU several times on the same group of files to rename them as I wish. I was wondering if there was a regular expression which would help.

I basically want to do three rename operations.

Replace '-' with ' - '
Replace '_' with ' '
Replace ' ' (double space) with ' ' (single space)

Is there someone that could kindly help?

Thanks
chris
 
Posts: 3
Joined: Tue Mar 23, 2010 11:21 am

Re: Multiple replace

Postby Stefan » Tue Mar 23, 2010 1:25 pm

chris wrote:Hi,

I regularly find myself needing to run BRU several times on the same group of files to rename them as I wish. I was wondering if there was a regular expression which would help.

I basically want to do three rename operations.

Replace '-' with ' - '
Replace '_' with ' '
Replace ' ' (double space) with ' ' (single space)

Is there someone that could kindly help?

Thanks

Hi chris, welcome.

You could take a look at this forum and see if this will help you:

* Board index ‹ Bulk Rename Utility ‹ Regular Expressions >> New Regular Expression Feature: what do you think?
>> http://www.bulkrenameutility.co.uk/forum/viewtopic.php?f=3&t=716

But i am not sure if this is already implemented? Please test and tell us.
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Multiple replace

Postby chris » Thu Mar 25, 2010 2:59 pm

Hi,

Happy to test, but I'm afraid I don't have the skills to write the RE in the first place :(
chris
 
Posts: 3
Joined: Tue Mar 23, 2010 11:21 am

Re: Multiple replace

Postby Stefan » Thu Mar 25, 2010 10:25 pm

chris wrote: I don't have the skills to write the RE in the first place :(

Upps :lol:
O.K., i'll check...
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: Multiple replace

Postby Stefan » Thu Mar 25, 2010 10:48 pm

Bad news

RegEx1&&RegEx2 -feature is not implemented.

And if it where, it wouldn't work for your issue, since BRU's RegEx has to match the whole file name always, not search&replace parts only.


---------------------------------

You may already know that you can save and reload current settings.
But three runs on a lot of files can take some time, not to talk about waiting to finish the run before doing the next step :roll:

If you want, you can try "ReNamer" at w-w.den4b.com

Replace '-' with ' - '
Replace '_' with ' '
Replace ' ' (double space) with ' ' (single space)

FROM:
A-B-C_D_E_F~~G~~~H~~~~i~~J.txt ( ~ means space )
TO:
A - B - C D E F G H i J.txt
USE:
Add this three rules (and save them for re-use)
1) Replace: Replace all "-" with " - " (skip extension)
2) Replace: Replace all "_" with " " (skip extension)
3) RegEx: Replace expression "\s{2,}" with " " (skip extension) --- or 3) CleanUp: Fix spaces, keep only one (skip extension)

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

Re: Multiple replace

Postby chris » Fri Mar 26, 2010 10:50 am

That helps massively - thanks so much :)
chris
 
Posts: 3
Joined: Tue Mar 23, 2010 11:21 am


Return to Regular Expressions


cron