# Export tag to single file in multiple folders

**URL:** <https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197>\
**Category:** Support\
**Created:** [March 18, 2020, 10:17pm UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197 "2020-03-18T22:17:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tadpole48](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tadpole48/32/7389_2.png) [@Tadpole48](https://community.mp3tag.de/u/Tadpole48)\
**Post date:** [March 18, 2020, 10:17pm UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/1 "2020-03-18T22:17:17Z")

</div>

I am new to exporting. I have a file structure for Audiobooks... Author\Bookname\ChapterXX.mp3  
Every file contains a Narrator tag.  
I am trying to create an additional single text file in each Bookname folder called Narrator.txt and have it contain the Narrator tag.  
I created an MTE file... $filename(%\_folderpath% txt,utf-16)%NARRATOR%  
and an Action to run it (EXPORT, Narrator.txt, Only one file per directory)  
and this works perfectly, but if I drag several folders into MP3TAG it only creates the file in the first folder! and not in each of them.  
Any ideas what I am doing wrong?

---

<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:** [March 19, 2020, 5:58am UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/2 "2020-03-19T05:58:57Z")

</div>

I think you should use as filename-descriptor the full path description, e.g.  
`d:\Audiobooks\%Author%\%Bookname%\%narrator%`

---

<div class="post-metadata">

**Author:** ![Tadpole48](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tadpole48/32/7389_2.png) [@Tadpole48](https://community.mp3tag.de/u/Tadpole48)\
**Post date:** [March 19, 2020, 10:26pm UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/4 "2020-03-19T22:26:04Z")

</div>

No this wont work, I know what you mean but the Meta data in the files is not always in the path structure.  
ie, Fred Blogs\Book 1\Chapter 1.MP3  
but Author tag in "Chapter 1.MP3" could be "Fred and Ginger Blogs"

I simply want to select multiple folders, drag them into MP3Tag select an Action and have MP3tag create a file in each folder called "Narrator.txt" which has the %NARRATOR% tag from the files in those folders.  
I get it to work with one folder, but when I use multiple folders it creates the "Narrator.txt" file only in the first folder and puts in the %NARROTOR% tag from the last!

---

<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:** [March 20, 2020, 5:25am UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/5 "2020-03-20T05:25:05Z")

</div>

You may have noticed that MP3tag has only 1 working directory at the time.  
Usually, any export ends up there unless you specifiy it in a different way where the export path is defined in a variable way.  
I think you know now what to look for: something that varies from file to file and can be used to address the location.

E.g. such a definition could work:  
`$filename($regexp(%_path%,(.*\\)(.*\.mp3),$1)Narrator.txt,utf-16)`

---

<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:** [March 20, 2020, 9:40am UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/6 "2020-03-20T09:40:38Z")

</div>

You just forgot the filename in your config:  
`$filename(%_folderpath%Narrator.txt,utf-16)%NARRATOR%`

---

<div class="post-metadata">

**Author:** ![Tadpole48](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tadpole48/32/7389_2.png) [@Tadpole48](https://community.mp3tag.de/u/Tadpole48)\
**Post date:** [March 20, 2020, 10:16am UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/7 "2020-03-20T10:16:45Z")

</div>

Super! so many thanks.

---

<div class="post-metadata">

**Author:** ![Tadpole48](https://community.mp3tag.de/user_avatar/community.mp3tag.de/tadpole48/32/7389_2.png) [@Tadpole48](https://community.mp3tag.de/u/Tadpole48)\
**Post date:** [March 20, 2020, 10:17am UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/8 "2020-03-20T10:17:44Z")

</div>

Thanks dano, I had realised that too - eventually!

---

<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:** [April 19, 2020, 10:17am UTC](https://community.mp3tag.de/t/export-tag-to-single-file-in-multiple-folders/48197/9 "2020-04-19T10:17:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
