Custom batch replacement

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Custom batch replacement

Postby mrmakrelli » Fri Feb 03, 2017 3:36 pm

Hi there, I'm quite new to using BRU, but it's so far been going quite well. I've hit a bit of a wall at the moment though. I need to replace a batch of files with custom information, and have it set so that I can reuse it at a later point.

For example, I need the following:

file-001.wav
file-002.wav
file-003.wav
...

To be:

file_24_C0.wav
file_27_D#0.wav
file_30_F#0.wav
...

There pattern isn't consistent, but I do have a template, and I need to apply this to many files that have the same suffixes. I basically want to be able to match and replace all files that have '-001' with '24_C0', all files with '-002' with '27_D#0' etc. I'm guessing I can set up a little script using RegEx, but it doesn't seem to be doing what I want it to do.

Any help would be greatly appreciated!
mrmakrelli
 
Posts: 3
Joined: Fri Feb 03, 2017 3:30 pm

Re: Custom batch replacement

Postby Admin » Sat Feb 04, 2017 12:36 am

Under "actions" in BRU there is a functionality called "import rename pairs". It allows you to create a list of renaming pairs in Excel for instance then import it in BRU. See help file for more info. thanks
Admin
Site Admin
 
Posts: 1521
Joined: Tue Mar 08, 2005 8:39 pm

Re: Custom batch replacement

Postby mrmakrelli » Sat Feb 04, 2017 12:56 am

Thanks for the reply, I did look into this but I can't seem to figure it out. My problem is that there are a few files that end in -001.wav, for example:

LDS-001.wav
PPR-001.wav
...

and I need them all to be updated, so the prefixes aren't all consistent. Sorry if I'm missing something very obvious. The help file seems to suggest that you can only do exact name changes.
mrmakrelli
 
Posts: 3
Joined: Fri Feb 03, 2017 3:30 pm

Re: Custom batch replacement

Postby Admin » Sat Feb 04, 2017 1:43 am

What is the complete list of replacements you need to do? e.g.

-001 with 24_C0
-002 with 27_D#0

etc
Admin
Site Admin
 
Posts: 1521
Joined: Tue Mar 08, 2005 8:39 pm

Re: Custom batch replacement

Postby mrmakrelli » Sat Feb 04, 2017 11:57 am

-001.wav|24_C0.wav
-002.wav|27_D#0.wav
-003.wav|30_F#0.wav
-004.wav|33_A0.wav
-005.wav|36_C1.wav
-006.wav|39_D#1.wav
-007.wav|41_F1.wav
-008.wav|44_G#1.wav
-009.wav|47_B1.wav
-010.wav|50_D2.wav
-011.wav|53_F2.wav
-012.wav|56_G#2.wav
-013.wav|59_B2.wav
-014.wav|62_D3.wav
-015.wav|65_F3.wav
-016.wav|69_A3.wav
-017.wav|71_B3.wav
-018.wav|74_D4.wav
-019.wav|76_F4.wav
-020.wav|78_G4.wav
-021.wav|82_A#4.wav

For now, I've just set up a massive text document with all possible permutations, but in future, I'd prefer a more elegant system if it was possible.
mrmakrelli
 
Posts: 3
Joined: Fri Feb 03, 2017 3:30 pm

Re: Custom batch replacement

Postby Admin » Mon Feb 06, 2017 2:24 am

So you can setup all the replacements needed that you listed above in a Javascript function (see Special (14)).
Then all the replacements on all files also in subfolders can be done with 1 click. If you need help next time please post here.
thanks
Admin
Site Admin
 
Posts: 1521
Joined: Tue Mar 08, 2005 8:39 pm


Return to Javascript Renaming