Case conversion...

Here are my two title-case MTA files: Title Case Action Files (Mackie) Link updated 22 April 2016

They add a series of corrections after running Mp3tag's Mixed Case function. Included are editable lists of abbreviations and acronyms that should be upper-case. If you open the MTA files in Notepad, you will see comments that describe each element in the action.

Note that my tag field actions cover just three fields and are slightly different for each field. That is by design but of course you can edit them as needed.

My regards and thanks to the posters here (including DetlevD) for the examples and explanations that I drew upon when creating these files.

Doug Mackie

Thanks, I'll give it a go. With regards to my other query, would you have an idea of how to achieve this, either using your script or the one I provided? Cheers.

Yog-Sothoth, you are quite welcome.

Your action starts with the supplied Mixed Case function, as does mine. At that point, your abbreviations have already lost capitalization after the first letter. That is why in my script I added a list of abbreviations to correct the errors. If you were writing a title-case script from scratch (i.e., not using Mixed Case), then $caps2() would be exactly what you want. My guess is that is what DetlevD meant, but of course we should let him speak for himself.

I did not attempt to write my script from scratch because it was much easier to let Florian's built-in Mixed Case function do the heavy-lifting, so to speak, and then to apply corrections afterwards.

Doug Mackie

Doug, your collection of 'cleaning and repair tools' looks very impressive, thank you for sharing it!


Cheers Doug, those scripts are very good. Thanks for your time.

Ok, I've done a little digging and found a solution. All credit to Stevest.

Action: Replace with regular expression
Field: _ALL
Regular expression: ^(.*)$
Replace matches with: $caps2($1)
[ ] case-sensitive comparison

I just replaced the Mixed Case action with this. Works like a charm. :laughing:


What I said above in post#2.


Sorry, co-credit to DetlevD too. :sunglasses:

Thanks. :music:


Update: There is a bug in the aforementioned action. If a comma is present anywhere in the field, all characters after the comma are truncated. For example, the title "Harp concerto in B-flat major, op. 4 Nr. 6: 1: Andante-Allegro" becomes "Harp ConCerto in B-Flat MaJor" after conversion. If I remove the comma beforehand, it converts to "Harp Concerto in B-flat Major Op. 4 Nr. 6: 1: Andante-Allegro", which is normal.

Humph, I guess I'm back to square one again. :frowning: Any ideas what is going wrong, anyone?

BTW, this is the offending action, just to avoid confusion:

Action: Replace with regular expression
Field: _ALL
Regular expression: ^(.*)$
Replace matches with: $caps2($1)
[ ] case-sensitive comparison

I can confirm the comma problem but I can't explain it. Perhaps someone else can.

However, that action has other problems. It preserves upper-case errors in the source text, which must then be fixed by hand. More important, unlike "Mixed Case", "Replace with Regular Expression" lacks the option for custom word boundary markers. So you must then add actions to correct the resulting errors after punctuation, brackets, and so on. Perhaps the regular expression could be rewritten to minimize the effects of this limitation, but it would be a challenge. The number of abbreviations and acronyms in my titles is limited, so in my scripts I prefer a "Mixed Case" action followed by lists with corrections. There are no problems with commas.

Unless I've misinterpreted you, I believe the other scripts in the action group (see first post) should correct these problems. I could be wrong on that though, so please tell me if you think I'm mistaken.

Granted, but I'm not so fortunate. I have quite a large collection (around 70k tracks), a great deal of which has upper-case words that would be incorrectly formatted with the mixed case action.

Yes it looks like bug in the action's parameter parsing resp. in the chaining of regexp and any other additionally function in the replacement parameter.

You can workaround this buggy behaviour by using the action this way:

Action: Replace with regular expression
Field: _ALL
Regular expression: ([^,]*)
Replace matches with: $caps2($1)
[ ] case-sensitive comparison


Yes, how someone will use the Mp3tag toolbox is always a mix of personal needs and skills and knowledge about how to find the perfect way in Mp3tag.

Personally I dislike to use the pseudo tag field _ALL, because it will lead to possibly corruption of many other other tag-field content like UNSYNCEDLYRICS, COMMENT and so on.
I like to put the focus on the tag-field which needs a change.
And because someone can combine as many actions as needed into one group of actions (or create several action groups), each single problem is still a single step and can be moved in the work flow to another place or removed or replaced by another solution without affecting other tasks.


Thank you DetlevD, that seems to have fixed the problem alright. Well done that man! applause

Of course, running Mixed Case alone is not enough. That is why my scripts have so many additional actions. Granted, I work mostly with pop and jazz titles, but the basic idea is the same. I took your Harp Concerto title above and ran my tag action on it, and it came out perfectly except for "Op." which came out "OP." That happened because OP is in my abbreviation list for "Out of Print".

Actually, as a Latinism, I would expect that opus and op. should be lower-case in music titles. That is an example of why I use word lists: they are good for catching errors made by others :slight_smile:


Hi Doug, I agree with what you say, except for one caveat. Most of these upper-case words happen to be in the artist field. So, AC/DC (the correct format) becomes Ac/Dc, 10CC -> 10cc, etc... Then there are acronyms that should be interspersed with stops but aren't, and so end up being formated to title case. There's just no way a word correction list can account for every eventuality, unfortunately. Of course, these methods are not mutually exclusive - I also use a word list. Cheers for the script though. I've merged some parts of it with mine and it's working very well.

Another update: I've done some more testing of the script and found a few problems. Firstly, Doug was right in saying that without the "words begin after" command in the native case conversion, it preserves or causes case errors. For instance, any word immediately after a bracket (like "(Featuring..." ) either remains or becomes lower-case after conversion. The original script I described in my first post used the mixed case function, with the following "words begin after" instruction: ({[]})-_",./+&@:;* Therefore, this somehow needs to be accounted for in the new script using a reg-ex action.

Secondly, DetlevD's solution has one minor flaw. If a bracket is left open, i.e. "(Remix", then the following error occurs: [ SYNTAX ERROR IN FORMATTING STRING ], and the field info is lost.

I really appreciate all the help I'm getting. Please help me fix this, once and for all. ^_^

I want to mention, that I did not offer a "solution", but only a workaround for a possible bug respectively for possible misuse of the Action "Replace using Regular Expession".
'yog-sothoth' you should raise a bug report about the both error cases which you have detected.

You should read the manual and check out, what the second parameter of the $caps2 function can do for you.


Instead of the first mixed case action try these two:

Action type: Replace with regular expression
Field: _TAG
Regular expression: ([-({\[\]}) _",./+&@:;*])(\l)
Replace matches with: $1$upper($2)
[x] case-sensitive comparison

Action type: Replace with regular expression
Field: _TAG
Regular expression: ^(\l)
Replace matches with: $upper($1)
[x] case-sensitive comparison