# filename-\>tag: Using directory as %artist%

**URL:** https://community.mp3tag.de/t/filename-tag-using-directory-as-artist/10221
**Category:** Support
**Created:** [April 1, 2010, 2:15pm UTC](https://community.mp3tag.de/t/filename-tag-using-directory-as-artist/10221 "2010-04-01T14:15:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![donalfitz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/5f8ce5/32.png) [@donalfitz](https://community.mp3tag.de/u/donalfitz)
#### Post date: [April 1, 2010, 2:15pm UTC](https://community.mp3tag.de/t/filename-tag-using-directory-as-artist/10221/1 "2010-04-01T14:15:42Z")

</div>

Hi there,

I've been trying to figure this out for a while, so forgive me if this post is a little long.

I have a directory structure like this: e:\books\audio\David\_Eddings\The\_Belgariad\02\_Queen \_of\_sorcery\01\_Queen\_of\_sorcery.ogg

Now what I'm trying to do is have the track number as 01, the title as Queen\_of\_sorcery, and the artist as David\_eddings. I can parse the filename with no problems, the bit I can't figure out is how to get the directory name included as the artist.

Very grateful for any assistance,

Donal

---

<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 1, 2010, 3:36pm UTC](https://community.mp3tag.de/t/filename-tag-using-directory-as-artist/10221/2 "2010-04-01T15:36:02Z")

</div>

> [@Donal](#):
>
> I have a directory structure like this: e:\books\audio\David\_Eddings\The\_Belgariad\02\_Queen \_of\_sorcery\01\_Queen\_of\_sorcery.ogg  
> Donal

make mp3tag to read in all the tracks in the path e:\books\audio  
then filter or select the files of david eddings (if you want to filter: %\_directory% HAS David\_Eddings)

Then use the function filename tag with this mask:

%artist%\%album%\%album%\%track%\_%title%

Right after that I think it is time for an action to replace all underscores with a blank. 😉

---

<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:22pm UTC](https://community.mp3tag.de/t/filename-tag-using-directory-as-artist/10221/3 "2026-02-09T12:22:17Z")

</div>


