# Tag from filename - using 3rd Directory

**URL:** https://community.mp3tag.de/t/tag-from-filename-using-3rd-directory/14396
**Category:** Support
**Created:** [January 28, 2013, 12:56am UTC](https://community.mp3tag.de/t/tag-from-filename-using-3rd-directory/14396 "2013-01-28T00:56:33Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [January 28, 2013, 7:37am UTC](https://community.mp3tag.de/t/tag-from-filename-using-3rd-directory/14396/3 "2013-01-28T07:37:50Z")

</div>

> [@akauriel](#):
>
> I'm having trouble writing a filter script that will help me pull the artist from my directories. I've got "D1/D2/Artist/....filename.mp3". ... Is there anyway to identify the 3rd directory in filter script /reg exp?

Maybe you can adapt something from there ...  
[/t/9324/1](https://community.mp3tag.de/t/9324/1)  
[/t/12021/1](https://community.mp3tag.de/t/12021/1)

You can simply solve your problem using this filter expression ...  
**"%\_folderpath%" HAS "\Bandhouse"**

... or use a regular expression to split the folderpath into folder components ...

**"$regexp(%\_folderpath%,'^.+?\\\\(.+?)\\\\(.+?)\\\\(.+?)\\\\.+$','$3')" IS "Bandhouse"**.

Here the components are ^Drive\Folder1\Folder2\Folder3\Remainder$

Note: The filter does not 'pull' something from anything, but restricts the list view for the currently loaded files, fitting to the filter expression.

If you want to 'pull' a partly value from the given file's folderpath, then you have to apply a scripting expression within a converter or action dialog.

DD.20130128.1005.CET

---

_[View the full topic](https://community.mp3tag.de/t/tag-from-filename-using-3rd-directory/14396)._
