# keep seperator in two segment filename to tag

**URL:** https://community.mp3tag.de/t/keep-seperator-in-two-segment-filename-to-tag/14344
**Category:** Support
**Created:** [January 12, 2013, 3:55pm UTC](https://community.mp3tag.de/t/keep-seperator-in-two-segment-filename-to-tag/14344 "2013-01-12T15:55:27Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [January 12, 2013, 4:35pm UTC](https://community.mp3tag.de/t/keep-seperator-in-two-segment-filename-to-tag/14344/2 "2013-01-12T16:35:13Z")

</div>

> [@ptbeau](#):
>
> my file name is like this:  
> Herbert von Karajan - DG Recordings - 069-01 - (1970) - Beethoven - Musik zu Goethes Trauerspiel Egmont - Op 84 - Ouvertüre.flac  
> and I would like to have in %track% = 069-01  
> and in the title :  
> Herbert von Karajan - DG Recordings - (1970) - Beethoven - Musik zu Goethes Trauerspiel Egmont - Op 84 - Ouvertüre.flac  
> keeping the " - " between karajan and DG and betwwen recordings and (1970)  
> Thank you, I'm a newbe to mp3tag

Read FAQ How do I create a new action?  
[Actions](https://community.mp3tag.de/t/967/2)

Here is a proposal, using a group of actions, doing the whole process in single steps.

Begin Action Group **Test\_2013#20130112.ptbeau** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_FN**  
_Formatstring:_ **%\_filename%**

 

Action #2  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%TMP\_FN%**  
_Guessing pattern:_ **%DUMMY% - %DUMMY% - %TRACK% - %DUMMY%**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TMP\_FN**  
_Formatstring:_ **$replace(%TMP\_FN%,' - '%TRACK%' - ',' - ')**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_FILENAME**  
_Formatstring:_ **%TMP\_FN%**

 

Action #5  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP\_FN**

 

End Action Group **Test\_2013#20130112.ptbeau** (5 Actions)

 

... other proposal ...

 Begin Action Group **Test\_2013#20130112.ptbeau (2)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TRACK**  
_Formatstring:_ **$regexp(%\_filename%,'^(.+?) - (.+?) - (.+?) - (.+?)$','$3')**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_FILENAME**  
_Formatstring:_ **$regexp(%\_filename%,'^(.+?) - (.+?) - (.+?) - (.+?)$','$1 - $2 - $4')**

 

End Action Group **Test\_2013#20130112.ptbeau (2)** (2 Actions)

 

... other proposal ...

 Begin Action Group **Test\_2013#20130112.ptbeau (3)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TRACK**  
_Formatstring:_ **$regexp(%\_filename%,'^(?:.+?)( - )(?:.+?)\1(.+?)\1(?:.+)$','$2')**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_FILENAME**  
_Formatstring:_ **$regexp(%\_filename%,'^(.+?)( - )(.+?)\2.+?\2(.+)$','$1$2$3$2$4')**

 

End Action Group **Test\_2013#20130112.ptbeau (3)** (2 Actions)

 

DD.20130112.1903.CET

---

_[View the full topic](https://community.mp3tag.de/t/keep-seperator-in-two-segment-filename-to-tag/14344)._
