Case conversion help needed

I have read all the RegEx stuff and tried a few things but nothing has worked but then again I have no idea what I am doing.

What I want is:

  1. the first letter of every word (tags, filenames, folder structure) to be capitalized
  2. I also need every letter preceded by /, [, (, ..., or a number to be capitalized
  3. I would like anything that is already capitalized to be left alone (ex. NIN)
  4. acronyms to be all caps (A.P.O.D)
  5. words like EP, CD, UK and roman numerals should be all caps
Can somebody PLEASE help me with this? I have spent far too much time away from my children trying to figure this out.

Thanks,

Chad

Please......

I really can't get this. I seem to be having the most trouble with getting the folder structure and leaving the forced capital words alone.

Have a look here of capitalizing functions.

Thanks for the response. I looked at that last night and basically Case conversion Normal (without changing uppercase characters) would work for me, but I don't really understand the example.....how do I just make it apply to everything and not just the certain tags?

I also just noticed that my script is capitalizing the first letter of the extension too and I need to make that stop.

Action: Replace with regular expression
Field: _ALL <-- It means the tag and the filename, but not the containing directory
Regular expression: ^(.*)$
Replace matches with: $caps2($1)
[ ] case-sensitive comparison

To capitalize the directory name, you should use _DIRECTORY in the field Field.

Can you please break this down for me....what does ^(.*)$ mean? I understand the rest. Is that what can start a "word"

I was using this:

(^|\s|(|[|/)'(.{1})

and

$1'$upper($2) and it is doing pretty much everything except leaving forced capital's alone.

^(.*)$ Step-by-step Explanation:

^ Starting at the beginning of the line of text …
( … save all that is in parentheses as "capture result" to be used later …
. … any character …
* … repeated zero or any number of times …
) … stop "capturing" …
$ … until the end of the line of text.

Meaning for human beings: "The WHOLE line" (or tag field).

Thanks, that really helps. So this will only capitalize and should not have any effect on forced uppercase words correct? For some reason what I was using above capitalized the first letter, but would lowercase things like Zz Top and Nin. Unfortunately I guess I will still have to go through those 18,000 songs and fix all that manually (unless you have another suggestion).

Chad

I just tried that string and it still lowers the forced upper case words. I really can't figure this out.

What you probably need is just applying »Format Value« actions to the fiels you really want changed, i.e., %artist%, %title%, %album%, %_filename%, %_directory%.

I’d then use something like (example):

ACTION GROUP »Format into Mixed Case«

ACTION »Format value«
Field: TITLE
Format string: $caps2(%title%,'/[(. -')

Note: There is a BLANK character between the ».« and the »-«!

This should convert case like you want (I hope): Making everything lowercase except at word beginnings and after characters like »/«, »[«, »(«, ».«, »blank«, and »-«.

Now for replacing »special words« like Roman Numerals, »CD« or »EP«, we simply add additional actions to the same action group. I demonstrate this here to always capitalize Roman Numerals as well as the words »EP« and »CD«:

ACTION »Replace with regular expression«
Field: TITLE
Regular expression: (\W)([ivxlcdm]+)(\W)
Replace matches with: $1$upper($2)$3
[_] case-sensitive comparison

(To be honest, I would recommend against trying to automatically convert roman numerals, since this will of course also transform words like »Mix« into »MIX«! I did this more for intellectual exercise … If we used this one, we could also scrap the next one, since »cd« would be converted by this regexp as well. If you really want to use the »automatics«, I’d really recommend to set up a Filter afterwards (i.e., press F3, select field TITLE in this case and enter (\W)([ivxlcdm]+)(\W) as the filter expression) and manually correct all badly converted »roman numerals«. Remember, it will also catch things like the English word »I«, the Italian article »Il«, the English word »Mix«, the German word »im«, etc.!)

ACTION »Replace with regular expression«
Field: TITLE
Regular expression: (\W)(cd)(\W)
Replace matches with: $1CD$3
[_] case-sensitive comparison

ACTION »Replace with regular expression«
Field: TITLE
Regular expression: (\W)(ep)(\W)
Replace matches with: $1EP$3
[_] case-sensitive comparison

Now for handling the other fields like %artist% and so on, you just replicate these steps. You can put everything together into one Action Group.

I just tested this with some files and it does convert a string like
this is from ZZ top w.a.s.p. (disc 1) ep/maxi-cd part ii, Chepcd (cd 1) four-fold © mmviii by me
into
This Is From ZZ Top W.A.S.P. (Disc 1) EP/Maxi-CD Part II, Chepcd (CD 1) Four-Fold © MMVIII By Me

You can see it

  • leaves already uppercased characters alone,
  • converts names like »W.A.S.P.«, »U.D.O.« as intended,
  • starts a new word after characters like »/[(.-«,
  • even uppercases roman numerals,
  • always converts »EP« and »CD« to uppercase, except if the letters »ep« or »cd« are part of another word (that’s the reason for the test word »Chepcd«)
Regarding the file name (%_filename%): If you don’t want to end up with odd errors due to illegal characters in the filename, I’d recommend to first format all fields it depends on like above, then add (as a last action in the group) something like:

ACTION »Format value«
Field: FILENAME
Format string: $validate($ansi(%artist% - %title%),)

This will keep filenames »clean« by substituting all »illegal« characters with an underscore »«, and also not change the existing file extension (».mp3« or the like). For our example above, this will rename the file to »Artist - This Is From ZZ Top W.A.S.P. (Disc 1) EP_Maxi-CD Part II, Chepcd (CD 1) Four-Fold © MMVIII By Me.mp3«. Note the »/« being changed to »«.

Hope this helps :slight_smile: