# Change 3rd Character To Uppercase

**URL:** https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075
**Category:** Support
**Created:** [June 1, 2011, 5:45pm UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075 "2011-06-01T17:45:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Beluna](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ed655f/32.png) [@Beluna](https://community.mp3tag.de/u/Beluna)
#### Post date: [June 1, 2011, 5:45pm UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075/1 "2011-06-01T17:45:39Z")

</div>

I have a lot of artists with names such as McDonald, McClaren, McKnight, etc... were the third character is changed to lower case...

Currently, I'm adding each name to an action, but that gets old quickly each time I discover a new name.

Can an action be created to replace all 3rd charter to upper case to Mc(x)night.

Thanks

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 1, 2011, 6:12pm UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075/2 "2011-06-01T18:12:14Z")

</div>

Hmm, you want a ready made Mp3tag action for this special case?  
How much time do you want to wait?

In the meantime you can study the Mp3tag Scripting Language and write your own scripting language format string.

A simple first start would be something like this ...

$left(%ARTIST%,2)$upper($mid(%ARTIST%,3,1))$right(%ARTIST%,$sub($len(%ARTIST%),3))  
... or ...  
$regexp(%ARTIST%,'^(..)(.)(.\*)$','$1\u$2$3')

From:  
Bread  
To:  
BrEad

You can set a filter to get only "Mc..." into view.  
ARTIST MATCHES "(?-i)^Mc.+$"

Read this thread ...  
[Case conversion...](https://community.mp3tag.de/t/11684/1)

DD.20110601.2218.CEST

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [June 2, 2011, 10:59am UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075/3 "2011-06-02T10:59:25Z")

</div>

> [@Beluna](#):
>
> I have a lot of artists with names such as McDonald, McClaren, McKnight, etc... were the third character is changed to lower case...
> 
> Currently, I'm adding each name to an action, but that gets old quickly each time I discover a new name.
> 
> Can an action be created to replace all 3rd charter to upper case to Mc(x)night.
> 
> Thanks

Try this.

_Name of action group:_ **Case TAG (Title Case BUT Keep Existing Caps)**

Action #1:  
_Action type:_ **Format value**  
_Field:_ **TITLE**  
_Formatstring:_ **$caps2(%title%,'/[(. -')**

Action #2:  
_Action type:_ **Format value**  
_Field:_ **ARTIST**  
_Formatstring:_ **$caps2(%artist%,'/[(. -')**

Action #3:  
_Action type:_ **Format value**  
_Field:_ **ALBUMARTIST**  
_Formatstring:_ **$caps2(%albumartist%,'/[(. -')**

Action #4:  
_Action type:_ **Format value**  
_Field:_ **ALBUM ARTIST**  
_Formatstring:_ **$caps2(%album artist%,'/[(. -')**

Action #5:  
_Action type:_ **Format value**  
_Field:_ **ALBUM**  
_Formatstring:_ **$caps2(%album%,'/[(. -')**

Action #6:  
_Action type:_ **Format value**  
_Field:_ **GENRE**  
_Formatstring:_ **$caps2(%genre%,'/[(. -')**

Action #7:  
_Action type:_ **Format value**  
_Field:_ **PUBLISHER**  
_Formatstring:_ **$caps2(%publisher%,'/[(. -')**

Here is a script which leaves all **UPPER** case characters and Leaves **eXAMples** like this but also changing the 1st **Letter Of Every Word To Caps**.

You can delete action 1-7 as you like. Hope this helps.

Also I picked this script up which changes the Mcdonald to McDonald and O'leary to O'Leary but make sure you use the filter while you make these changes as DetlevD states.

_Name of action group:_ **Case TAG (O'Leary, McKenna)**

Action #1:  
_Action type:_ **Replace with regular expression**  
_Field:_ **\_TAG**  
_Regular expression:_ **O'(.{1})**  
_Replace matches with:_ **O'$upper($1)**

[] case-sensitive comparison

Action #2:  
_Action type:_ **Replace with regular expression**  
_Field:_ **\_TAG**  
_Regular expression:_ **(Mc|Mac)((?:[a-z]|-){3,})(?# Scottish names with 3 or more letters after "Mc" or "Mac", hyphenated or not)**  
_Replace matches with:_ **$1$caps2($2,-)**

[] case-sensitive comparison

---

<div class="post-metadata">

### Author: ![Beluna](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ed655f/32.png) [@Beluna](https://community.mp3tag.de/u/Beluna)
#### Post date: [June 2, 2011, 11:34am UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075/4 "2011-06-02T11:34:33Z")

</div>

> [@stevehero](#):
>
> Try this.
> 
> _Name of action group:_ **Case TAG (Title Case BUT Keep Existing Caps)**
> 
> Action #1:  
> _Action type:_ **Format value**  
> _Field:_ **TITLE**  
> _Formatstring:_ **$caps2(%title%,'/[(. -')**
> 
> Action #2:  
> _Action type:_ **Format value**  
> _Field:_ **ARTIST**  
> _Formatstring:_ **$caps2(%artist%,'/[(. -')**
> 
> Action #3:  
> _Action type:_ **Format value**  
> _Field:_ **ALBUMARTIST**  
> _Formatstring:_ **$caps2(%albumartist%,'/[(. -')**
> 
> Action #4:  
> _Action type:_ **Format value**  
> _Field:_ **ALBUM ARTIST**  
> _Formatstring:_ **$caps2(%album artist%,'/[(. -')**
> 
> Action #5:  
> _Action type:_ **Format value**  
> _Field:_ **ALBUM**  
> _Formatstring:_ **$caps2(%album%,'/[(. -')**
> 
> Action #6:  
> _Action type:_ **Format value**  
> _Field:_ **GENRE**  
> _Formatstring:_ **$caps2(%genre%,'/[(. -')**
> 
> Action #7:  
> _Action type:_ **Format value**  
> _Field:_ **PUBLISHER**  
> _Formatstring:_ **$caps2(%publisher%,'/[(. -')**
> 
> Here is a script which leaves all **UPPER** case characters and Leaves **eXAMples** like this but also changing the 1st **Letter Of Every Word To Caps**.
> 
> You can delete action 1-7 as you like. Hope this helps.
> 
> Also I picked this script up which changes the Mcdonald to McDonald and O'leary to O'Leary but make sure you use the filter while you make these changes as DetlevD states.
> 
> _Name of action group:_ **Case TAG (O'Leary, McKenna)**
> 
> Action #1:  
> _Action type:_ **Replace with regular expression**  
> _Field:_ **\_TAG**  
> _Regular expression:_ **O'(.{1})**  
> _Replace matches with:_ **O'$upper($1)**
> 
> [] case-sensitive comparison
> 
> Action #2:  
> _Action type:_ **Replace with regular expression**  
> _Field:_ **\_TAG**  
> _Regular expression:_ **(Mc|Mac)((?:[a-z]|-){3,})(?# Scottish names with 3 or more letters after "Mc" or "Mac", hyphenated or not)**  
> _Replace matches with:_ **$1$caps2($2,-)**
> 
> [] case-sensitive comparison

I like the suggestion with O'Leary. Didn't know actually, where to get started.  
Thanks

---

<div class="post-metadata">

### Author: ![Beluna](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/ed655f/32.png) [@Beluna](https://community.mp3tag.de/u/Beluna)
#### Post date: [June 2, 2011, 11:37am UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075/5 "2011-06-02T11:37:37Z")

</div>

> [@DetlevD](#):
>
> Hmm, you want a ready made Mp3tag action for this special case?  
> How much time do you want to wait?
> 
> In the meantime you can study the Mp3tag Scripting Language and write your own scripting language format string.
> 
> A simple first start would be something like this ...
> 
> $left(%ARTIST%,2)$upper($mid(%ARTIST%,3,1))$right(%ARTIST%,$sub($len(%ARTIST%),3))  
> ... or ...  
> $regexp(%ARTIST%,'^(..)(.)(.\*)$','$1\u$2$3')
> 
> From:  
> Bread  
> To:  
> BrEad
> 
> You can set a filter to get only "Mc..." into view.  
> ARTIST MATCHES "(?-i)^Mc.+$"
> 
> Read this thread ...  
> [Case conversion...](https://community.mp3tag.de/t/11684/1)
> 
> DD.20110601.2218.CEST

Thanks for the quick response. One of those issues you put off until you wonder if there's a better way of doing something redundant. I'll review the suggestions given.

---

<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:23pm UTC](https://community.mp3tag.de/t/change-3rd-character-to-uppercase/12075/6 "2026-02-09T12:23:08Z")

</div>


