# Moving and swapping items in title

**URL:** <https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702>\
**Category:** Support\
**Created:** [May 1, 2014, 3:06pm UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702 "2014-05-01T15:06:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guttersnipe](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/ebca7d/32.png) [@Guttersnipe](https://community.mp3tag.de/u/Guttersnipe)\
**Post date:** [May 1, 2014, 3:06pm UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702/1 "2014-05-01T15:06:18Z")

</div>

Looking to set up some rules to my mp3 collection so files will look like this

Song Title (feat. Xyz) [Abc remix]

I currently have a bunch of files that look the opposite so

Song Title [Abc Remix] (feat. Xyz)

Is there any way to swap these over en masse?

---

<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:** [May 1, 2014, 3:17pm UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702/2 "2014-05-01T15:17:36Z")

</div>

You could use an action of the type "Format Tag-Field" for TITLE  
Enter as format string: `$regexp('%title%','(.*) (\[.*\]) (\(.*\))',$1 $3 $2)`

You should get the same result with an action of the type "Replace with regular expression" for TITLE  
Enter as search string: `(.*) (\[.*\]) (\(.*\))`  
Enter as replace string:$1 $3 $2

Or enter  
` $regexp('%title%','(.*) (\[.*\]) (\(.*\))',$1 $3 $2)`  
in the Convert\>tag-tag  
function for %title%

---

<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:** [May 1, 2014, 4:30pm UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702/3 "2014-05-01T16:30:06Z")

</div>

> [@Guttersnipe](#):
>
> Song Title (feat. Xyz) [Abc remix]  
> Song Title [Abc Remix] (feat. Xyz)  
> Is there any way to swap these over en masse?

Here is a somewhat unusual proposal, but it works.

Begin Action Group **Test\_2014#20140501.Guttersnipe (1)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TITLE**  
_Formatstring:_ **$replace(%TITLE%,' (','\\',') [','\\',']','\\')**  
... or ...  
_Formatstring:_ **$regexp(%TITLE%,'\s\*(?:(|)\s+[|])\s\*','\\')**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TITLE**  
_Formatstring:_ **$meta(TITLE,0)' ['$meta(TITLE,2)'] ('$meta(TITLE,1)')\\'**

 

End Action Group **Test\_2014#20140501.Guttersnipe (1)** (2 Actions)

 

Here is a proposal, which swaps a character sequence, enclosed into round brackets, ...  
with a following character sequence, enclosed into square brackets, and vice versa.

 Begin Action Group **Test\_2014#20140501.Guttersnipe (2)** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **TITLE**  
_Formatstring:_ **$if($eql('()',$regexp(%TITLE%,'[^][()]',)),$regexp(%TITLE%,'^(._?)((.+?))(._)([.+?])(._?)$__','$1$4$3$2$5'),$if($eql('',$regexp(%TITLE%,'[^][()]',)),$regexp(%TITLE%,'^(._?)([.+?])(._)((.+?))(._?)$','$1$4$3$2$5'),%TITLE%))**

 

End Action Group **Test\_2014#20140501.Guttersnipe (2)** (1 Action)

 

DD.20140501.2030.CEST, DD.20140502.1110.CEST, DD.20140506.1200.CEST

---

<div class="post-metadata">

**Author:** ![Guttersnipe](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/ebca7d/32.png) [@Guttersnipe](https://community.mp3tag.de/u/Guttersnipe)\
**Post date:** [May 6, 2014, 6:32am UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702/4 "2014-05-06T06:32:15Z")

</div>

> [@ohrenkino](#):
>
> You could use an action of the type "Format Tag-Field" for TITLE  
> Enter as format string: $regexp('%title%','(._) ([._]) ((.\*))',$1 $3 $2)
> 
> You should get the same result with an action of the type "Replace with regular expression" for TITLE  
> Enter as search string: (._) ([._]) ((.\*))  
> Enter as replace string:$1 $3 $2
> 
> Or enter  
> $regexp('%title%','(._) ([._]) ((.\*))',$1 $3 $2)  
> in the Convert\>tag-tag  
> function for %title%

Thanks this works

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [February 19, 2023, 8:11pm UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702/5 "2023-02-19T20:11:15Z")

</div>

A post was split to a new topic: [Move and swap items in title](https://community.mp3tag.de/t/move-and-swap-items-in-title/60123)

---

<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:** [March 21, 2023, 8:11pm UTC](https://community.mp3tag.de/t/moving-and-swapping-items-in-title/15702/6 "2023-03-21T20:11:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
