# Multiple files using export

**URL:** https://community.mp3tag.de/t/multiple-files-using-export/6206
**Category:** Export
**Created:** [February 7, 2008, 2:01pm UTC](https://community.mp3tag.de/t/multiple-files-using-export/6206 "2008-02-07T14:01:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![captainmac](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/57b2e6/32.png) [@captainmac](https://community.mp3tag.de/u/captainmac)
#### Post date: [February 7, 2008, 2:01pm UTC](https://community.mp3tag.de/t/multiple-files-using-export/6206/1 "2008-02-07T14:01:53Z")

</div>

Nevermind. I was able to achieve the results I needed by specifying %\_directory% in the "Export File Name:" dialog box.

~~Hi all,~~

Just a quick question on exporting.

I have hundreds of directorys that I need to gather info on but I would like one file per directory containing only what is in that directory and I would like to name each text file the same as the directory name.

Here is what I'm using right now and it creates one text file with all the info I need. But as I said I would like individual text files for each directory.

%\_directory%  
$loop(%\_path%)%track%|%title%  
$loopend()

Thanks in advance.

Michael

---

<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: [February 7, 2008, 7:31pm UTC](https://community.mp3tag.de/t/multiple-files-using-export/6206/2 "2008-02-07T19:31:33Z")

</div>

Just to add this, you can also define the filename in the config:

$filename(%\_folderpath%%\_directory%.txt,ansi)%\_directory%  
$loop(%\_path%)%track%|%title%  
$loopend()

---

<div class="post-metadata">

### Author: ![captainmac](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/57b2e6/32.png) [@captainmac](https://community.mp3tag.de/u/captainmac)
#### Post date: [February 7, 2008, 8:14pm UTC](https://community.mp3tag.de/t/multiple-files-using-export/6206/3 "2008-02-07T20:14:51Z")

</div>

This works, thanks. However, when I have the %filename command inserted it adds an extra line of space at the top of the file. I checked my config file and I didn't have any stray returns anywhere so I'm not sure why I'm getting the extra line.

Also, in some outputs the track listing is not sorted. Some times is comes out as:

1|track\_1  
10\_track\_10  
2|track\_2

But other times it sorts correctly as:

1|track\_1  
2|track\_2  
...  
10|track\_10

Any ideas on why it would do this? Below is my script.

$filename(%\_folderpath%%\_directory%.txt,UTF-8)%\_directory%  
$loop(%\_path%)%track%|%title%  
$loopend()

Thanks  
Michael
