#1 2016-03-16 13:55

ChrisW
Member
From: Toronto
Registered: 2016-03-16
Posts: 2

Changing case in specific parts of filename

I'm new to ReNamer and would like to change the case in certain areas of filenames of record albums. From searching on the website it looks like Code B from the Partial Case Change script in the Wiki would be my best option, but I'm unsure of how to modify it to fit my needs. I have played around with some of the variables, but the resulting filename becomes a mess.

Examples of the files I wish to change:

GROUP1_-_ATTIKON_ATT416A
GROUP2_-_COLUMBIA_7151-F-CO23365
GROUP3_-_COLUMBIA_7221-F-CO32207
GROUP4_-_ODEON_HGRA17-OGA2795

I would like the groups and record labels to be changed so only the first letters of the words are capitalized.  The remainder of the name (catalog numbers), I wish to leave as is:

Group1_-_Attikon_ATT416A
Group2_-_Columbia_7151-F-CO23365
Group3_-_Columbia_7221-F-CO32207
Group4_-_Odeon_HGRA17-OGA2795

Would someone be able to advise what I should be modifying in that script or is there a better method I hadn't considered? If it helps, all the groups and record labels are currently separated by _-_ and all the catalog numbers are separated from the record labels by a single underscore.  I plan on cleaning up that once the cases are all squared away.

Cheers,

Chris

Last edited by ChrisW (2016-03-16 14:32)

Offline

#2 2016-03-16 14:38

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,479

Re: Changing case in specific parts of filename

Hello Chris,

Yes, you could do that in PascalScript, but if you are not familiar with coding it may be better to use RegEx rule.

The following two RegEx rules will accomplish your task, as in your example:
1) RegEx: Replace expression "\A(.*?)_-_(.*?)_" with "\L$1_-_\L$2_" (skip extension)
2) RegEx: Replace expression "\A(.*?)_-_(.*?)_" with "\u$1_-_\u$2_" (skip extension)

These rules use "_-_" and "_" delimiters to identify needed parts. "\L" converts the whole match to lower case and "\u" converts the first letter to upper case.

Offline

#3 2016-03-16 15:36

ChrisW
Member
From: Toronto
Registered: 2016-03-16
Posts: 2

Re: Changing case in specific parts of filename

Thank you so much for that quick reply and assistance.  It worked beautifully.

Cheers,

Chris

Offline

Board footer

Powered by FluxBB