Need help for an action!

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! :stuck_out_tongue: :smiley:

Use Convert > Tag - filename and enter

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

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?)

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

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. :stuck_out_tongue: :smiley:)

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 ")"

This is a new requirement?

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

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

DD.20120406.1230.CEST

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

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
(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.

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