# Case conversion help needed

**URL:** https://community.mp3tag.de/t/case-conversion-help-needed/7341
**Category:** Support
**Created:** [October 17, 2008, 3:03am UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341 "2008-10-17T03:03:43Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![pillshovel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@pillshovel](https://community.mp3tag.de/u/pillshovel)
#### Post date: [October 17, 2008, 3:03am UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/1 "2008-10-17T03:03:43Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pillshovel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@pillshovel](https://community.mp3tag.de/u/pillshovel)
#### Post date: [October 17, 2008, 5:53pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/2 "2008-10-17T17:53:48Z")

</div>

> [@pillshovel](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [October 17, 2008, 6:25pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/3 "2008-10-17T18:25:29Z")

</div>

Have a look [here](https://docs.mp3tag.de/scripting) of capitalizing functions.

---

<div class="post-metadata">

### Author: ![pillshovel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@pillshovel](https://community.mp3tag.de/u/pillshovel)
#### Post date: [October 17, 2008, 7:49pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/4 "2008-10-17T19:49:09Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [October 17, 2008, 9:09pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/5 "2008-10-17T21:09:19Z")

</div>

**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.

---

<div class="post-metadata">

### Author: ![pillshovel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@pillshovel](https://community.mp3tag.de/u/pillshovel)
#### Post date: [October 17, 2008, 10:44pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/6 "2008-10-17T22:44:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Moonbase](https://community.mp3tag.de/user_avatar/community.mp3tag.de/moonbase/32/207_2.png) [@Moonbase](https://community.mp3tag.de/u/Moonbase)
#### Post date: [October 18, 2008, 8:59am UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/7 "2008-10-18T08:59:28Z")

</div>

**^(.\*)$** 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).

---

<div class="post-metadata">

### Author: ![pillshovel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@pillshovel](https://community.mp3tag.de/u/pillshovel)
#### Post date: [October 18, 2008, 2:09pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/8 "2008-10-18T14:09:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![pillshovel](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@pillshovel](https://community.mp3tag.de/u/pillshovel)
#### Post date: [October 19, 2008, 2:23am UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/9 "2008-10-19T02:23:07Z")

</div>

> [@pillshovel](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![Moonbase](https://community.mp3tag.de/user_avatar/community.mp3tag.de/moonbase/32/207_2.png) [@Moonbase](https://community.mp3tag.de/u/Moonbase)
#### Post date: [October 19, 2008, 3:11pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/10 "2008-10-19T15:11:45Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:21pm UTC](https://community.mp3tag.de/t/case-conversion-help-needed/7341/11 "2026-02-09T12:21:09Z")

</div>


