#  Replacing in Title tags 

**URL:** https://community.mp3tag.de/t/replacing-in-title-tags/14120
**Category:** Support
**Created:** [November 12, 2012, 10:53pm UTC](https://community.mp3tag.de/t/replacing-in-title-tags/14120 "2012-11-12T22:53:26Z")
**Posts on this page:** 1
**Showing post:** 6

<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: [November 14, 2012, 6:27am UTC](https://community.mp3tag.de/t/replacing-in-title-tags/14120/6 "2012-11-14T06:27:54Z")

</div>

> [@MichaelZulu](#):
>
> Hi I'd like to learn how to Replace the variable length of my Title tags ...  
> From this:  
> Mozart P Con #6 In B Flat, K 238 - 3. Rondeau  
> Mozart P Con #7 In F For 2/3 Pianos, K 242, "Lodron" - 1. Allegro  
> Mozart P Con #7 In F For 2/3 Pianos, K 242, "Lodron" - 2. Adagio  
> Mozart P Con #7 In F For 2/3 Pianos, K 242, "Lodron" - 3. Rondeau  
> Mozart P Con #8 In C, K 246, "Lützow" - 1. Allegro Aperto  
> To This:  
> Mozart P Con #6 - 3  
> Mozart P Con #7 - 1  
> Mozart P Con #7 - 2  
> Mozart P Con #7 - 3  
> Mozart P Con #8 - 1  
> I imagine this is an action but if it is multiple Tag-tag that would be great - maybe even more clear? Thanks

Your example strings have varying length and look like as they are following always the same pattern.  
%TMP1% #%TMP2% %DUMMY% - %TMP3%. %DUMMY%  
There are fix points in each string, so you can use an action "Guess values" to split the original title string into parts and save the valueable parts into temporary tag-fields.  
Then assemble the new title string from the temporary tag-fields and put it in a temporary tag-field too.  
If the results are looking good, then overwrite the tag-field TITLE with the newly calculated title value.  
Afterwards remove the temporary helper tag-fields.

Here is an action group which has all steps included.

Begin Action Group **Test\_2012#20121114.MichaelZulu** 

Action #1  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%TITLE%**  
_Guessing pattern:_ **%TMP1% #%TMP2% %DUMMY% - %TMP3%. %DUMMY%**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP4**  
_Formatstring:_ **%TMP1% #%TMP2% - %TMP3%**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TITLE**  
_Formatstring:_ **%TMP4%**

 

Action #4  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP1;TMP2;TMP3;TMP4**

 

End Action Group **Test\_2012#20121114.MichaelZulu** (4 Actions)

 

You can also solve this task using the converter "Tag - Tag" and a regular expression function.

  

**Convert** | **Tag - Tag** | **ALT+5**

 

_Select format string_

 

Field:  
**TITLE**

 

Format string:

 **$regexp(%TITLE%,'^(.+#\d+)\s.+(\s-\s\d+).+$','$1$2')** 

Preview  
"Mozart P Con #6 In B Flat, K 238 - 3. Rondeau" -\>  
"Mozart P Con #6 - 3"

 

"Mozart P Con #7 In F For 2/3 Pianos, K 242, "Lodron" - 1. Allegro" -\>  
"Mozart P Con #7 - 1"

 

"Mozart P Con #7 In F For 2/3 Pianos, K 242, "Lodron" - 2. Adagio" -\>  
"Mozart P Con #7 - 2"

 

"Mozart P Con #7 In F For 2/3 Pianos, K 242, "Lodron" - 3. Rondeau" -\>  
"Mozart P Con #7 - 3"

 

"Mozart P Con #8 In C, K 246, "Lützow" - 1. Allegro Aperto" -\>  
"Mozart P Con #8 - 1"

  

DD.20121114.0840.CET

---

_[View the full topic](https://community.mp3tag.de/t/replacing-in-title-tags/14120)._
