# Parsing the %\_folderpath%

**URL:** https://community.mp3tag.de/t/parsing-the-folderpath/10632
**Category:** Export
**Created:** [August 11, 2010, 1:29pm UTC](https://community.mp3tag.de/t/parsing-the-folderpath/10632 "2010-08-11T13:29:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![goondoo27](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/ee7513/32.png) [@goondoo27](https://community.mp3tag.de/u/goondoo27)
#### Post date: [August 11, 2010, 1:29pm UTC](https://community.mp3tag.de/t/parsing-the-folderpath/10632/1 "2010-08-11T13:29:41Z")

</div>

I have my music organized as follows:

\music\<letter\>\<artist\>\<album\>\<file\>

For example:  
w:\music\A\ACDC\Back In Black\01 - ACDC - Hells Bells.mp3  
w:\music\A\ACDC\Back In Black\02 - ACDC - Shoot To Thrill.mp3  
w:\music\A\ACDC\Back In Black\03 - ACDC - What Do You Do For Money Honey.mp3

I'm using this export script to get all of my Albums into a .csv file:

$filename(artist-album-%\_datetime%.csv)  
"Artist","Album","Path","Genre","Total Size","Total Files"  
$loop(%\_folderpath%,1)"%artist%","%album%","%\_folderpath%","%genre%","%\_total\_size%","%\_total\_files%"  
$loopend()

It works great for almost everything. The problem I'm having is that when I get to Various Artists, instead of putting the string "Various Artists" into the .csv file, it puts the artist from one of the files. Here's an example:

w:\music\V\Various Artists\Billboard Top Hits 1985\01 - REO Speedwagon - Can't Fight This Feeling.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\02 - Tears for Fears - Shout.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\03 - Mr. Mister - Broken Wings.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\04 - Huey Lewis & the News - The Power of Love.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\05 - Starship - We Built This City.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\06 - John Parr - St. Elmo's Fire.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\07 - Jan Hammer - Miami Vice Theme.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\08 - Ready For The World - Oh Sheila.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\09 - Billy Ocean - Loverboy.mp3  
w:\music\V\Various Artists\Billboard Top Hits 1985\10 - Glenn Fry - The Heat Is On.mp3

When I run the Export script I get this entry:  
"Billy Ocean","Billboard Top Hits -1985","W:\Music\v\Various Artists\Billboard Top Hits 1985","Rock/Pop","37.87 MB","10"

What I want is this:  
"Various Artists","Billboard Top Hits -1985","W:\Music\v\Various Artists\Billboard Top Hits 1985","Rock/Pop","37.87 MB","10"

My idea is to parse the %\_folderpath% variable for the artists name, but I have no idea how to do this.

Any help? Any other suggestions?  
John

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [August 11, 2010, 2:39pm UTC](https://community.mp3tag.de/t/parsing-the-folderpath/10632/2 "2010-08-11T14:39:17Z")

</div>

Try %\_parent\_directory%

---

<div class="post-metadata">

### Author: ![goondoo27](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/ee7513/32.png) [@goondoo27](https://community.mp3tag.de/u/goondoo27)
#### Post date: [August 12, 2010, 1:20am UTC](https://community.mp3tag.de/t/parsing-the-folderpath/10632/3 "2010-08-12T01:20:27Z")

</div>

Wow. That was easy. Thanks for the help!
