# Problem deriving artist from filename

**URL:** <https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916>\
**Category:** Support\
**Created:** [September 9, 2009, 5:10pm UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916 "2009-09-09T17:10:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![whitesmith](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/a5b964/32.png) [@whitesmith](https://community.mp3tag.de/u/whitesmith)\
**Post date:** [September 9, 2009, 5:10pm UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916/1 "2009-09-09T17:10:14Z")

</div>

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.

---

<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:** [September 9, 2009, 5:46pm UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916/2 "2009-09-09T17:46:10Z")

</div>

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](https://docs.mp3tag.de/scripting)

---

<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:** [September 10, 2009, 2:00am UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916/3 "2009-09-10T02:00:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)\
**Post date:** [September 13, 2009, 6:50pm UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916/4 "2009-09-13T18:50:12Z")

</div>

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

Isn't V2.44 better? 🙂

---

<div class="post-metadata">

**Author:** ![whitesmith](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/a5b964/32.png) [@whitesmith](https://community.mp3tag.de/u/whitesmith)\
**Post date:** [September 25, 2009, 11:33am UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916/5 "2009-09-25T11:33:34Z")

</div>

This did the job for me. Thanks much!

---

<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:21pm UTC](https://community.mp3tag.de/t/problem-deriving-artist-from-filename/8916/6 "2026-02-09T12:21:46Z")

</div>

Closed on February 9, 2026, 12:21pm UTC


