# Information from directory name to tag

**URL:** https://community.mp3tag.de/t/information-from-directory-name-to-tag/6100
**Category:** Support
**Created:** [January 19, 2008, 11:50am UTC](https://community.mp3tag.de/t/information-from-directory-name-to-tag/6100 "2008-01-19T11:50:00Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Mihey](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/13edae/32.png) [@Mihey](https://community.mp3tag.de/u/Mihey)
#### Post date: [January 19, 2008, 11:50am UTC](https://community.mp3tag.de/t/information-from-directory-name-to-tag/6100/1 "2008-01-19T11:50:00Z")

</div>

Hi,

I have a bunch of mp3s with empty **YEAR** tag, but each of the singles is contained in " **Artist - Year - Title**" folder. How do I extract the year from it into the **YEAR** tag?

By the way, I tried **Actions** , particularly **Replace with regular expression**. I matched the empty field and used scripting function in "replace with":

```
$regexp(%_directory%,.+\s-\s(\d+)\s-\s.+,$1)

```

But it seems not to recognize "%\_directory%" as a placeholder for parent directory (YEAR = "%\_directory%"). I couldn't find a list of placeholders to be used in scripting functions and took this one from Columns. M-m, was that wrong?

---

_[View the full topic](https://community.mp3tag.de/t/information-from-directory-name-to-tag/6100)._
