# Convert Artist and album of the artist in a title capitalized.

**URL:** <https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785>\
**Category:** Support\
**Created:** [March 31, 2015, 4:55pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785 "2015-03-31T16:55:58Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [March 31, 2015, 4:55pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/1 "2015-03-31T16:55:58Z")

</div>

Hello, I would like to know how to if for example the title of my songs happens to be the name of my artist or album of the artist for his latter capitalized but have the rest of the way without changing the nival majuscle sensitive. Thank you.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 31, 2015, 5:18pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/2 "2015-03-31T17:18:29Z")

</div>

I hope I got that right - google translate does a lot of funny things: "changing the nival majuscle sensitive" ...

Create an action of the type "Format value" for TITLE  
Format string: $replace(%title%,%artist%,$upper(%artist%))

This puts - if it finds the contents of ARTIST somewhere in TITLE - the artist all in capitals, e.g.

"Avril Lavigne - Anything but Ordinary" -\> "AVRIL LAVIGNE - Anything but Ordinary"

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 1, 2015, 10:29am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/3 "2015-04-01T10:29:55Z")

</div>

I think we understand it but it does not.

I just capitalize the title part that includes the artist's name in it and the rest of the way nothing changes.

ARTIST: ATYPUS  
TITLE: atypus - Real blade  
After the convertion TITLE: ATYPUS - Real blade

but it does not work with your code.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 1, 2015, 11:44am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/4 "2015-04-01T11:44:36Z")

</div>

It does not work with "my" code because your artist field does not match the case in the title.  
If the artist part in title is all lower case use this:  
$replace(%title%,$lower(%artist%),$upper(%artist%))

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 1, 2015, 3:49pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/5 "2015-04-01T15:49:42Z")

</div>

Sorry, I understood, but I wanted to have it is a corespondance My artist in my title whatever it is written and capitalize the name of the artist who is in my title.

example:

ARTIST: ATYPUS  
TITLE: atypus - Real blade  
ou  
TITLE: Atypus - Real blade  
ou  
TITLE: ATYPUS - Real blade  
ou  
TITLE: ATyPuS - Real blade

Result: ATYPUS - Real blade

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 1, 2015, 4:36pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/6 "2015-04-01T16:36:45Z")

</div>

~~I cannot think of any regular expression that switches the case of a pattern variable.  
The only way out seems to me that you first filter all tracks where the artist is in the title, then you extract that artist into a separate user-defined field where you can swap the case and then you add that string again to the title.~~

$regexp($lower(%title%),$lower(%artist%),$upper(%artist%))  
leads unfortunately to the rest of the title being in lower case ....

PS: a personal note: why do you have to have the artist in the title when you already have got it in the artist field? - I would delete it from the title.  
Why is the case so mixed up?  
Why does the artist name have to "yell" at you in capitals?  
Don't answer any of these questions. They were just rethorical ones.

try this:

$if($strstr(%title%,%artist%),$regexp(%title%,(._) - (._),$upper(%artist%) - $2),%title%))

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 1, 2015, 6:41pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/7 "2015-04-01T18:41:52Z")

</div>

Story just for you die not stupid, it is rather the albumartist I would like to change.

I always name my artists and albumartist ALL CAPS. Better visibility for me. My titles are appointed with a capital at the beginning of the sentence with some phrase more like '|.!? &' And some others. Proper names which happens to be in my title are made with a word beginning capitalized.

It happens that sometimes in my title is found to be included albumartist. Yes, because for compilatons the title is sometimes called with albumartist because I called in this case the artist with the name of the compilation and albumartist with the actual name of the artist.

Because, yes sir, I'm a man complicated. I like having my tags in a way no other. So am in life, I would never do anything like the others.

Thank you for your help, I have tried your code and it is well. A+ 😛

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 1, 2015, 6:50pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/8 "2015-04-01T18:50:48Z")

</div>

I saw that you had changed your topic suddenly the new code to me, but a break like that) at the end of the title?

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 1, 2015, 8:26pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/9 "2015-04-01T20:26:19Z")

</div>

With the new code there is this) has the end of my title?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 2, 2015, 4:38am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/10 "2015-04-02T04:38:45Z")

</div>

I had to take care of the family.  
See if the  
$if($strstr(%title%,%artist%),$regexp(%title%,(._) - (._),$upper(%artist%) - $2),%title%))  
should be  
$if($strstr(%title%,%artist%),$regexp(%title%,(._) - (._),$upper(%artist%) - $2),%title%)  
(Can't test it at the moment)

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 2, 2015, 6:07am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/11 "2015-04-02T06:07:08Z")

</div>

The following code is well.

```
$if($strstr(%title%,%artist%),$regexp(%title%,(.*) - (.*),$upper(%artist%) - $2),%title%)

```

Thank you of your time and of your energy past found a solution. Yo.

---

<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:** [April 2, 2015, 6:32am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/12 "2015-04-02T06:32:53Z")

</div>

> [@Sylvain.dmde](#):
>
> The following code is well.
> 
> ```
> $if($strstr(%title%,%artist%),$regexp(%title%,(.*) - (.*),$upper(%artist%) - $2),%title%) ...
> 
> ```

**$if($strstr(%TITLE%,%ARTIST%), ============================== $regexp(%TITLE%,(.\*) - (.\*),$upper(%ARTIST%) - $2) ,%TITLE%) ========= My condolences ... the underlined part of the formatstring is syntactically "murks" or "scrap", ... this instruction has no functionality, therefore you can remove it.**

Simply use this formatstring:

**$regexp(%TITLE%,'(.+?) - (.+?)','\U$1 - $2')**

... or ...

**$upper($left(%TITLE%,$strstr(%TITLE%,' - ')))$cutLeft(%TITLE%,$strstr(%TITLE%,' - '))**

... or ...

**$upper(%ARTIST%)' '$cutLeft(%TITLE%,$strstr(%TITLE%,' - '))**

DD.20150402.1106.CEST

---

<div class="post-metadata">

**Author:** ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)\
**Post date:** [April 2, 2015, 7:25am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/13 "2015-04-02T07:25:10Z")

</div>

Thank you I again tried both code view higher, he walks well has the exception of titles. I do not know why. Whether he is to spell with capital letters or without.

```
$if($strstr(%title%,%albumartist%),$regexp(%title%,(.*) - (.*),$upper(%albumartist%) - $2),%title%)

```

TITLE:Finale / Reprise (orchestra - only version)  
Result: DANNY ELFMAN - only version)

```
$regexp(%TITLE%,'(.+?) - (.+?)','\U$1 - $2')

```

TITLE: Finale / Reprise (orchestra - only version)  
Result: FINALE / REPRISE (ORCHESTRA - Only version)

---

<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:** [April 2, 2015, 8:12am UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/14 "2015-04-02T08:12:03Z")

</div>

Your current new example ...  
now working with the tag-field %albumartist% ...  
using this formatstring ...

$if($strstr(%title%,%albumartist%),$regexp(%title%,(._) - (._),$upper(%albumartist%) - $2),%title%)

TITLE:Finale / Reprise (orchestra - only version)  
Result: DANNY ELFMAN - only version)

is a bad scripting example like the other one forementioned.

**$if($strstr(%TITLE%,%ALBUMARTIST%), =================================== $regexp(%TITLE%,(.\*) - (.\*),$upper(%ALBUMARTIST%) - $2) ,%TITLE%) ========= My condolences ... the underlined part of the formatstring is syntactically "murks" or "scrap", ... this instruction has no functionality, therefore you can remove it.**

```
$regexp(%TITLE%,'(.+?) - (.+?)','\U$1 - $2')

```

TITLE: Finale / Reprise (orchestra - only version)  
Result: FINALE / REPRISE (ORCHESTRA - Only version)[/quote]

The given formatstring works as designed, ...  
the result complies with the rule of the given regular expression.

**Note:**  
You should strictly avoid to mingle things together, which are not member of the same case.

This input string ...  
'Finale / Reprise (orchestra - only version)'  
... has not the right format to be treated in a correct fashion using this formatstring ...  
$regexp(%TITLE%,'(.+?) - (.+?)','\U$1 - $2')

... but all the example cases, which you gave at the beginning of this thread ...  
ARTIST: ATYPUS  
TITLE: atypus - Real blade  
TITLE: Atypus - Real blade  
TITLE: ATYPUS - Real blade  
TITLE: ATyPuS - Real blade  
... can be treated without any error ...  
... with this formatstring ...  
$regexp(%TITLE%,'(.+?) - (.+?)','\U$1 - $2')

As a final good-intentioned response:  
do change your working behavior in relation to your tagging and data handling.

Invest more time for the care of the individual tag fields, ...  
then you can use the content from the tag-fields to assemble each complicated file name as you like.  
Doing this way, you will save much more time, than you need now for struggling with formatstrings, for which you are not able to read and understand.

DD.20150402.1212.CEST

---

<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:25pm UTC](https://community.mp3tag.de/t/convert-artist-and-album-of-the-artist-in-a-title-capitalized/16785/15 "2026-02-09T12:25:37Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


