# Album Name from Directory Name

**URL:** https://community.mp3tag.de/t/album-name-from-directory-name/7792
**Category:** Support
**Created:** [January 18, 2009, 9:14am UTC](https://community.mp3tag.de/t/album-name-from-directory-name/7792 "2009-01-18T09:14:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![SAU](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/3e96dc/32.png) [@SAU](https://community.mp3tag.de/u/SAU)
#### Post date: [January 18, 2009, 9:14am UTC](https://community.mp3tag.de/t/album-name-from-directory-name/7792/1 "2009-01-18T09:14:51Z")

</div>

Hi

My songs do not have accurate tag information. The only information which is reliable is the folder names they are into. I want to update the tag information based on the file path as follows:

Album = File's Directory Name  
Title = File Name

So if i have 1000 songs(S1,S2,S3,S4...S1000) in 100 directories(D1,D2...D100).  
I want to update  
S1.Album = Directory of S1  
S1.Title = Filename of S1 (without the .mp3 extension)

Can Mp3tag v2.42 able to do this. I can see it can format from filename but i am unable to do that from directory.

---

<div class="post-metadata">

### Author: ![gah789](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/cdc98d/32.png) [@gah789](https://community.mp3tag.de/u/gah789)
#### Post date: [January 18, 2009, 3:58pm UTC](https://community.mp3tag.de/t/album-name-from-directory-name/7792/2 "2009-01-18T15:58:33Z")

</div>

Unless I am missing something, this is quite straightforward. All you need to do is to create a template for the Filename - Tag conversion. Mine is:

\%artist%\%album%\%track% - %title%

which tells mp3tag that the file D:\MP3\_Files\Abba\Compilation\01 - People need love.mp3 should get a tag with Artist = Abba, Album = Compilation, Track = 01, Title = "People need love". The program goes as far up the directory structure as required to extract the fields, so that it does not use the D:\MP3\_Files part of the full name. Further, it strips off the file type from the filename.

In your case it seems that you need the following template:

\%album%\%title%

You can convert as many files as you need - but test the template first!

---

<div class="post-metadata">

### Author: ![DaFox](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/96bed5/32.png) [@DaFox](https://community.mp3tag.de/u/DaFox)
#### Post date: [January 18, 2009, 6:11pm UTC](https://community.mp3tag.de/t/album-name-from-directory-name/7792/3 "2009-01-18T18:11:04Z")

</div>

Thanks for this gah789 helped me out quite a lot. But uh do you know of a way to make it if the title has "(feat. Someone)" to add that part onto the Artist field instead of the title field.

Thanks.

---

<div class="post-metadata">

### Author: ![k000](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/53a042/32.png) [@k000](https://community.mp3tag.de/u/k000)
#### Post date: [January 19, 2009, 5:27am UTC](https://community.mp3tag.de/t/album-name-from-directory-name/7792/4 "2009-01-19T05:27:25Z")

</div>

BTW, you can also use Action for 'Format Value' and then use %\_directory%

---

<div class="post-metadata">

### Author: ![tourist-tam](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tourist-tam](https://community.mp3tag.de/u/tourist-tam)
#### Post date: [February 27, 2009, 7:48pm UTC](https://community.mp3tag.de/t/album-name-from-directory-name/7792/5 "2009-02-27T19:48:19Z")

</div>

> [@DaFox](#):
>
> Thanks for this gah789 helped me out quite a lot. But uh do you know of a way to make it if the title has "(feat. Someone)" to add that part onto the Artist field instead of the title field.
> 
> Thanks.

You just have to create some rules to match the variables you want to extract and apply the actions. Don't forget to delete from the tag the temporary variables. I might be doing something unconventional, but it works.

Assuming that your track is named as follow: "01 - MainArtist - TheTitle (feat - Featuring).mp3"

Filename - Tag %var1% - %artist% - %title% (feat - %var2%)  
Tag - Filename $num(%track%,2) - %artist%, %var2% - %title%

Tam

---

<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/album-name-from-directory-name/7792/6 "2026-02-09T12:21:19Z")

</div>


