# Extract album name from path name with string operations

**URL:** https://community.mp3tag.de/t/extract-album-name-from-path-name-with-string-operations/10519
**Category:** Support
**Created:** [June 5, 2010, 9:15am UTC](https://community.mp3tag.de/t/extract-album-name-from-path-name-with-string-operations/10519 "2010-06-05T09:15:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cruder](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/91b2a8/32.png) [@cruder](https://community.mp3tag.de/u/cruder)
#### Post date: [June 5, 2010, 9:15am UTC](https://community.mp3tag.de/t/extract-album-name-from-path-name-with-string-operations/10519/1 "2010-06-05T09:15:12Z")

</div>

Hi everyone,

I have tons of MP3s organized in folders like this

> [CATNO] Artist - Album Name (Year)

 for instance:

> [FRD127] Tony Lionni - Treat Me Right (2009)

 It would be great if I'd be able to extract the album (for the album tag) from the directory name in the form of:

> [FRD127] Treat Me Right (2009)

 essentially removing everything between the first occurrence of '] ' and the first occurrence of '- '. So far I am aware of $replace, $strstr, etc. but I just can't figure out how to put it together with all the parameters and so on (at least for a non-techie). Any help is highly appreciated.

Thanks

Catherine

---

<div class="post-metadata">

### Author: ![cruder](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/91b2a8/32.png) [@cruder](https://community.mp3tag.de/u/cruder)
#### Post date: [June 5, 2010, 12:13pm UTC](https://community.mp3tag.de/t/extract-album-name-from-path-name-with-string-operations/10519/2 "2010-06-05T12:13:40Z")

</div>

I think I figured it out: I ended up using the file name to tag conversion with following setup:

> %album% %artist% - %album%\%track% %dummy% - %title%

That way I worked around the scripting functions.

Thanks anyway.  
Catherine

---

<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: [June 5, 2010, 12:18pm UTC](https://community.mp3tag.de/t/extract-album-name-from-path-name-with-string-operations/10519/3 "2010-06-05T12:18:56Z")

</div>

> [@cruder](#):
>
> Hi everyone,
> 
> I have tons of MP3s organized in folders like this
> 
> > [CATNO] Artist - Album Name (Year)
> 
> for instance:
> 
> > [FRD127] Tony Lionni - Treat Me Right (2009)
> 
> Catherine

Why don't you use the function "filename - tag"

with a pattern that looks like this:

%dummy%] %artist% - %album% (%year%)\%dummy%

the important bit is the backslash in front of the second %dummy%. This tells the mask to take parts of the path as well.  
While you type along the mask you should see in the preview whether the mask suits you.

---

<div class="post-metadata">

### Author: ![cruder](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/91b2a8/32.png) [@cruder](https://community.mp3tag.de/u/cruder)
#### Post date: [June 5, 2010, 1:03pm UTC](https://community.mp3tag.de/t/extract-album-name-from-path-name-with-string-operations/10519/4 "2010-06-05T13:03:28Z")

</div>

> [@ohrenkino](#):
>
> Why don't you use the function "filename - tag"
> 
> with a pattern that looks like this:
> 
> %dummy%] %artist% - %album% (%year%)\%dummy%

Alright, that's even more convenient. I didn't realize at first that I can work with folder names as part of the conversion pattern, which is awesome and does the trick.

Thanks for your help  
Catherine

---

<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/extract-album-name-from-path-name-with-string-operations/10519/5 "2026-02-09T12:22:26Z")

</div>


