Problem deriving artist from filename

My collection of classical music is organized using the composer's last name as the subdirectory, and his compositions under that. For example, under Music\Beethoven\ there are files named like:

Choral Fantasy -- Op. 80_Otto Klemperer_New Philharmonia Orchestra_Daniel Barenboim (piano), John Alldis Choir.flac

I want to set up an action to extract the title, conductor, band and artist. Based on my experience with Basic, Perl and C, I would expect the correct action for Artist would be:

Format value "ARTIST": $mid(%_filename%, $strrchr(%filename%,'') + 1, $strlen(%_filename%) - $strrchr(%filename%,'') - 1)

But this expression yields an empty field for Artist. I stayed up until 3 this morning trying to figure out what I'm doing wrong. I would be grateful for any help.

By the way, I'm using v2.43, which I intend to nominate for best of the year.

For math operations you need to use functions like $add(x,y) or $sub(x,y)
Just + and - has no effect.
https://docs.mp3tag.de/scripting

Using Mp3tag's special mask features you do not have to do complicated math.

Have a look at the filename structure.
Choral Fantasy -- Op. 80_Otto Klemperer_New Philharmonia Orchestra_Daniel Barenboim (piano), John Alldis Choir.flac
part1 -- part2_part3_part4_part5

For parts you do not want to extract you simply use the dummy placeholder, otherwise use the appropriate named placeholders.
If you want to extract only the artist part you can write such a mask:
%dummy% -- %dummy%%dummy%%dummy%_%artist%

  1. You can use converter.

Convert | Filename - Tag | ALT+2
Select format string
Examplestring: Choral Fantasy -- Op. 80_Otto Klemperer_New Philharmonia Orchestra_Daniel Barenboim (piano), John Alldis Choir.flac
Formatstring: %dummy% -- %dummy%%dummy%%dummy%_%artist%
Preview
artist | Daniel Barenboim (piano), John Alldis Choir

  1. You can use action.
    Actiontype 7: Import tag fields (guess values)
    Source format: %filename%
    Guessing pattern: %dummy%÷--÷%dummy%%dummy%%dummy%%artist%
    Note: Replace one special ÷ character with one space character.

DD.20090910.0606.CEST

By the way, I'm using v2.43, which I intend to nominate for best of the year.

Isn't V2.44 better? :slight_smile:

This did the job for me. Thanks much!