Change 3rd Character To Uppercase


#1

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


create action group
#2

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

DD.20110601.2218.CEST


#3

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

#4

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


#5

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.