# Need help for an action!

**URL:** https://community.mp3tag.de/t/need-help-for-an-action/13292
**Category:** Support
**Created:** [April 4, 2012, 4:24pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292 "2012-04-04T16:24:08Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Hornhaut68](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Hornhaut68](https://community.mp3tag.de/u/Hornhaut68)
#### Post date: [April 4, 2012, 4:24pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/1 "2012-04-04T16:24:08Z")

</div>

What I have to do, to delete all characters after the last ")" of the filename. For exemple:

_Artist - Song (Song-addition) (Mix)lalalala_ **to** _Artist - Song (Song-addition) (Mix)_

or

_Artist - Song (Mix)lalalala_ **to** _Artist - Song (Mix)_

Hope you can help me! 😛 😃

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [April 4, 2012, 6:04pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/2 "2012-04-04T18:04:57Z")

</div>

Use Convert \> Tag - filename and enter

$regexp(%\_filename%,')[^()]+$',')')

---

<div class="post-metadata">

### Author: ![Hornhaut68](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Hornhaut68](https://community.mp3tag.de/u/Hornhaut68)
#### Post date: [April 5, 2012, 7:03am UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/3 "2012-04-05T07:03:26Z")

</div>

_And that counts for any form of tags? I mean is this form is searching for the last ")"?_

Very cool thank's, everthing works fine.

(I put this in an "Formate Tags" action, and it works fine. As I copy that into Mp3Tag there was a space there, I delete it,but I thought it was right, because it wasn't necessary, right?)

---

<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 5, 2012, 12:57pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/4 "2012-04-05T12:57:11Z")

</div>

> [@Hornhaut68](#):
>
> What I have to do, to delete all characters after the last ")" of the filename. ...

Action: Format value  
Field: \_FILENAME  
Formatstring:

**$left(%\_filename%,$strrchr(%\_filename%,')'))**

... or ...

 

**Convert** | **Tag - Filename** | **ALT+1**

 

_Select format string_

 

Format string:  
**$left(%\_filename%,$strrchr(%\_filename%,')'))**

 

Preview  
**Artist - Song (Song-addition) (Mix).mp3**

 

... or ...

 

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

 

_Select format string_

 

Field:  
**\_FILENAME**

 

Format string:  
**$left(%\_FILENAME%,$strrchr(%\_FILENAME%,')'))**

 

Preview  
**Artist - Song (Song-addition) (Mix)**

 

DD.20120405.1658.CEST

---

<div class="post-metadata">

### Author: ![Hornhaut68](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Hornhaut68](https://community.mp3tag.de/u/Hornhaut68)
#### Post date: [April 6, 2012, 7:20am UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/5 "2012-04-06T07:20:00Z")

</div>

So, I thoguht about that, and that what I really need is, that everthing after the second or fourth ")" will be delete, but that MP3Tag will search for that, if there's fourth closed bracket, it will delete that which will follow, but if not he delte everthing after the second closed bracket, is this possible?

(I just saw, that the last action [_$left(%\_filename%,$strrchr(%\_filename%,')'))_] above will delete all information out of the filename if theres is no bracket in it. The first one [_$regexp(%\_filename%,')[^()]+$',')')_] act like the same above, but don't delete everything out of the filename if there's not a bracket in it.)

(All two actions worked fine, but there's a solution for the "problem" above, please tell me. 😛 😃)

---

<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 6, 2012, 8:04am UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/6 "2012-04-06T08:04:07Z")

</div>

> [@Hornhaut68](#):
>
> ...I just saw, that the last action [_$left(%\_filename%,$strrchr(%\_filename%,')'))_] above will delete all information out of the filename if theres is no bracket in it. ...

Hm, yes, you are responsible for selecting the appropriate file name before applying the formula.  
You can filter the view by a filter expression like this ...  
"%\_FILENAME%" HAS ")"

> [@Hornhaut68](#):
>
> So, I thoguht about that, and that what I really need is, that everthing after the second or fourth ")" will be delete, but that MP3Tag will search for that, if there's fourth closed bracket, it will delete that which will follow, but if not he delte everthing after the second closed bracket, is this possible? ...

This is a new requirement?

Filter expression for two groups of opening and closing round brackets...  
"%\_FILENAME%" MATCHES "\[1\]_([^()]_?)[^()]_([^()]_?)[^()]_$"  
... or ...  
"%\_FILENAME%" MATCHES "^(?:[^()]_([^()]_?)){2,2}[^()]_$"  
... or ...  
"%\_FILENAME%" MATCHES "^(?:[^()]_([^()]_?)[^()]\*){2,2}$"

Filter expression for four groups of opening and closing round brackets...  
"%\_FILENAME%" MATCHES "\[2\]_([^()]_?)[^()]_([^()]_?)[^()]_([^()]_?)[^()]_([^()]_?)[^()]_$"  
... or ...  
"%\_FILENAME%" MATCHES "^(?:[^()]_([^()]_?)){4,4}[^()]_$"  
... or ...  
"%\_FILENAME%" MATCHES "^(?:[^()]_([^()]_?)[^()]\*){4,4}$"

DD.20120406.1230.CEST

* * *

1. ^() 

2. ^()

---

<div class="post-metadata">

### Author: ![Hornhaut68](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/6de8d8/32.png) [@Hornhaut68](https://community.mp3tag.de/u/Hornhaut68)
#### Post date: [April 6, 2012, 8:17am UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/7 "2012-04-06T08:17:35Z")

</div>

Ok, thank's for all that actions, I'll try and choose that one which works best.

---

<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 6, 2012, 12:05pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/8 "2012-04-06T12:05:05Z")

</div>

I'd still say that the best procedure would be to apply the converter filename-filename instead of insisting on an action.  
But this has been described exhaustively in  
[Aktion für Trackumbennenung](https://community.mp3tag.de/t/13287/12)  
(the German thread where you asked the same question).  
Using that converter plus the filter  
%\_filename% HAS ")"  
would save you the bother of catering for various amounts of bracket pairs.  
But everyone may do as he pleases.

---

<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 6, 2012, 1:41pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/9 "2012-04-06T13:41:50Z")

</div>

> [@Hornhaut68](#):
>
> Ok, thank's for all that actions, I'll try and choose that one which works best.

I would say ... the smartest proposal has been done by dano (see above in this thread) ...  
Use Convert \> Tag - filename and enter ...

**$regexp(%\_filename%,'\)[^()]+$',')')**

... and maybe this will work too, just for the case when the last character is the closing round bracket ...

**$regexp(%\_filename%,'\)[^()]\*$',')')**

If you want to solve the problem using basic scripting functions, then this complicated looking expression will do it too.

**$reverse($cutLeft($reverse(%\_filename%),$sub($strchr($reverse(%\_filename%),')'),1)))**

DD.20120406.1740.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:23pm UTC](https://community.mp3tag.de/t/need-help-for-an-action/13292/10 "2026-02-09T12:23:46Z")

</div>


