BRU options from a text file

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

BRU options from a text file

Postby mwrose4 » Sun Mar 01, 2020 5:18 pm

Hello all,

I am new to this utility and so far absolutely LOVE it. I have thousands of Karaoke files acquired from many sources and am undertaking the task of cleaning those up, renaming them to a standard naming convention and removing duplicates.

What I have found is some sources have the source name of the karaoke file inside the name, in a different place than where I want it.

3 Doors Down - Here Without You [SC Karaoke].cdg - [SC KAraoke] is the source for this file.

My format to use is Source - Track - Artist - Title

So, I have managed to figure out in BRU (3.0, just downloaded 3.3 today), to use regular expressions to find the specific files I want to change.

Filters (12) RegEx is [SC Karaoke]
My Add(7) (Prefix) is SC Karaoke - - (since this file has no track number, I am adding another blank and delimiter)
My Remove (5) Chars is [SC Karaoke]


This changes

3 Doors Down - Here Without You [SC Karaoke].cdg

to

SC Karaoke - - 3 Doors Down - Here Without You.cdg


This worked like a champ. However, the source I got this particular set of files from has about 40 different "Sources" in the file listings. This is only one example, there are many others like this. I know I can manually set this each time, but I would love to be able to import a text file or CSV file individual settings for each option. This would allow me to more quickly and efficiently make changes.

Maybe something like:

(5)(5) [SC Karaoke], (7)(1) SC Karaoke, (12)(2) [SC Karaoke]
0r
(5)(Chars) [SC Karaoke], (7)(Prefix) SC Karaoke, (12)(RegEx) [SC Karaoke]

My format is:

(5) the number listed in the options for Remove
(5) the 5th option in the Remove section or it could be "Chars" for the Chars option
Text to be removed (mine includes the [] but not sure if you would have to escape those or not.)
then a coma as a delimiter
Next section.

Now, as I have said, I am new and maybe this is already out there and I have missed it. I have seen the import feature with old name and new name, but if I am going to type that out for all of the files, it defeats the purpose of the bulk renaming to save time.

Thanks for you time and this really cool utility.

Mike R.
mwrose4
 
Posts: 3
Joined: Sun Mar 01, 2020 4:51 pm

Re: BRU options from a text file

Postby RegexNinja » Mon Mar 02, 2020 3:10 am

Hi
If you're saying that [Source] is always in the filename, and NOT within the file's content, #1Regex easily handles this, but..
Do some files already have the Track-info within the filename?? If so what's the Track format??
I'm unfamiliar with such formats, so I'll steer clear of posting an answer to handle them.
Just as an example:

#1 Regex Match/Replace:
^([^-]* - )([^[-]*) \[(.*?)\]$
\3 - - \1\2
Results in:
3 Doors Down - Here Without You [SC Karaoke] --------> SC Karaoke - - 3 Doors Down - Here Without You

While this automates all your other settings, I'd hesitate using it, unless none of your names have the Track-info.
If some of your files do have the Track-info, I'll need some samples, so I know how to match them.
Cheers!
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: BRU options from a text file

Postby RegexNinja » Mon Mar 02, 2020 9:43 pm

Actually, the regex is perfectly safe to use alongside with names with any Track-info.
It wont touch them, since it mandates the existence of only 1 Space-Space as the Artist/Title separator.
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: BRU options from a text file

Postby mwrose4 » Tue Mar 03, 2020 2:30 pm

Where do I learn more about the #1RegExp? I have not yet looked at the newest version. It looks like that is new fir the version I had. I am assuming it is partial scripting?
mwrose4
 
Posts: 3
Joined: Sun Mar 01, 2020 4:51 pm

Re: BRU options from a text file

Postby RegexNinja » Wed Mar 04, 2020 9:05 am

Hi, all versions of BRU include RegExp.. Its not really scripting, but it is quite powerful.

It looks like RegEx (1) underneath your folder tree structure (with Match and Replace underneath).
Just paste the code into those boxes to see your results.

The best place for learning is the new manual at http://www.bulkrenameutility.co.uk/foru ... =12&t=4743
And there is always the forum, I should've posted more about how it works.. I'm not the best at explaining.

It works by (Grouping) text in the MatchBox and letting you represent those Groups with \# in the ReplaceBox.
Each (Group) in the MatchBox gets numbered from 1-9, anything outside of a (Group) means you dont want to keep it.

#1 Regex Match/Replace:
^([^-]* - )([^[-]*) \[(.*?)\]$
\3 - - \1\2


^ = Start matching at very 1st-character in the filename
Group1= AnyNumberOfNonDashes Until The-1st Space-Space
Group2= AnyNumberOfChars except [ and -
Space\[ isnt (Grouped) since you want to lose Space[ but [ is a special-regex-char, so you need \[ instead.
Group3=AnyTextWhatsoverUntil ...
\] Again, not (Grouped) cuz you dont wanna keep it, and since ] is a special-regex-char, you have to type \] instead.
$ Ensures that ] was the final-character
RegexNinja
 
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Re: BRU options from a text file

Postby trm2 » Tue Mar 10, 2020 8:34 pm

The 'forthcoming' Volume II will also address a lot of RegEx, but RegexNinja is right - you can get a pretty good start using Volume I and
volume I IS available now at that link that was supplied.. It will also show you every (almost?) aspect of how to use the program. Oh and did I mention it's
F R E E !!! - over 300 pages!
trm2
 
Posts: 156
Joined: Wed Jan 15, 2020 12:47 pm


Return to Suggestions