# Export field to a file

**URL:** <https://community.mp3tag.de/t/export-field-to-a-file/17199>\
**Category:** Support\
**Created:** [September 2, 2015, 8:46pm UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199 "2015-09-02T20:46:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bert003](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/b5a626/32.png) [@bert003](https://community.mp3tag.de/u/bert003)\
**Post date:** [September 2, 2015, 8:46pm UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/1 "2015-09-02T20:46:26Z")

</div>

I would like to save info from the PUBLISHER field to a filename. That may be a 0 byte file with only the Publisherfield as filename.

I did manage to export a cover to a file named %PUBLISHER%.jpg  
But the disadvantage is that if there is no cover there will be no file and if the PUBLISHER field is empty I get a nameless ".jpg" file.

Does someone knows how to create an action which creates an empty filename with the Publisher as filename? And only if the publisher field is present. When the Publisher field is blank no file is needed. 1 file for 1 directory is enough.

---

<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:** [September 3, 2015, 3:07am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/2 "2015-09-03T03:07:12Z")

</div>

Do not use an action but a tool.  
Create a tool in File\>Options\>Tools  
Select the command shell cmd.exe as program and add these parameters:  
/c echo Publisher '%publisher%' \> %publisher%.txt

---

<div class="post-metadata">

**Author:** ![bert003](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/b5a626/32.png) [@bert003](https://community.mp3tag.de/u/bert003)\
**Post date:** [September 3, 2015, 7:16am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/3 "2015-09-03T07:16:51Z")

</div>

That works. I had to place the filename between " " to make it work correctly.

Still, when there is no publisher I get a nameless .txt file.

And it could lead to many instances of the command prompt at the same time when processing many files.

It is not a very elegant solution but it works. I'd rather use an action because there I do all most other things. An action which starts a tool would be nice to prevent one has to use the right mousebutton to start a tool.

If I prefer the method with exporting a cover fom a file named %publisher%.jpg, which can be done from an action, which notation can I use to prevent creating a nameless .jpg file?

---

<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:** [September 3, 2015, 7:21am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/4 "2015-09-03T07:21:34Z")

</div>

> [@bert003](#):
>
> ...  
> If I prefer the method with exporting a cover fom a file named %publisher%.jpg, which can be done from an action, which notation can I use to prevent creating a nameless .jpg file?

Use a filter?  
Enter a dummy publisher?  
If there is an embedded picture, the export will create a file... So you have to take precautions like filtering.  
Even the absence of data is data.

In respect to the command shell: you can use a batch file that checks for the existence of data or files. You would then call that batch file instead of the command shell command directly.  
See e.g. here for more information about shell syntax: [http://ss64.com/nt/syntax.html](http://ss64.com/nt/syntax.html)

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [September 3, 2015, 7:32am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/5 "2015-09-03T07:32:13Z")

</div>

> [@bert003](#):
>
> I would like to save info from the PUBLISHER field to a filename. That may be a 0 byte file with only the Publisherfield as filename.

You have to go via Mp3tag "Export" dialog ~~or via Mp3tag "Export" action~~.  
Apply an export script like following ...

**1: $filename($getEnv('TEMP')'\CreateTextfileForPublisher.cmd',ANSI)** 

**2: $loop(%_folderpath%__)$if(%PUBLISHER%,'@ECHO.\>"'$left(%folderpath%$validate($meta\_sep(PUBLISHER,''),'_'),255)'.txt"',)  
3: $loopend()  
4: '@DEL %0\>NUL'**

 

DD.20150903.1132.CEST, DD.20150903.1330.CEST

---

<div class="post-metadata">

**Author:** ![bert003](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/b5a626/32.png) [@bert003](https://community.mp3tag.de/u/bert003)\
**Post date:** [September 3, 2015, 7:53am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/6 "2015-09-03T07:53:12Z")

</div>

What I basicly want is when the Publisher field contains data, a file with a name like "Publisher- Stockfisch Records" is placed in the directory where the album is. No extension needed, and no file has to be created when the publisher is unknown/blank.

I use it just as reminder when browsing in windows explorer. If path length wasn't an issue I would put it in the directory name.

I will have a look with scripts, I have never used it, but I will try Detlevs proposal.

Another possbility is to create a file with information which is always available and which makes some sense.  
I.e. a file with Bitdepth-Samplefreq-Filetype (Publisher):

16bit-44kHz-FLAC (.no extesion)  
or  
16bit-44kHz-FLAC (Publisher- Stockfisch Records) (.no extesion)  
when the publisher is available.

Ideas ideas...

---

<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:** [September 3, 2015, 7:59am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/7 "2015-09-03T07:59:03Z")

</div>

The windows explorer has a number of search options for the advanced search that would make this information available without the use of extra files (which then have to be kept up to date)

see e.g. [http://windows.microsoft.com/de-de/windows...hing-in-windows](http://windows.microsoft.com/de-de/windows7/advanced-tips-for-searching-in-windows)

(there should be non-German site).

---

<div class="post-metadata">

**Author:** ![bert003](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/b5a626/32.png) [@bert003](https://community.mp3tag.de/u/bert003)\
**Post date:** [September 3, 2015, 9:17am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/8 "2015-09-03T09:17:24Z")

</div>

Actually I do my searches with Everything file finder. It only indexes file- and foldernames but with instant results and zero waittime.

---

<div class="post-metadata">

**Author:** ![bert003](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/b5a626/32.png) [@bert003](https://community.mp3tag.de/u/bert003)\
**Post date:** [September 3, 2015, 10:51am UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/9 "2015-09-03T10:51:32Z")

</div>

> [@DetlevD](#):
>
> You have to go via Mp3tag "Export" action or via "Export" dialog.  
> Apply an export script like following ...
> 
> **1: $filename($getEnv('TEMP')'\CreateTextfileForPublisher.cmd',ANSI)** 
> 
> **2: $loop(%_folderpath%__)$if(%PUBLISHER%,'@ECHO.\>"'$left(%folderpath%$validate($meta\_sep(PUBLISHER,''),'_'),255)'.txt"',)  
> 3: $loopend()  
> 4: '@DEL %0\>NUL'**
> 
>  
> 
> DD.20150903.1132.CEST, DD.20150903.1330.CEST

Are you sure this works?

I created a 'new export configuration' file, deleted what's in and pasted your 4 rows of code.  
When applied as an action I get a '[SYNTAX ERROR IN FORMATTING STRING]' file.  
Via the menu file export the same result

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [September 3, 2015, 2:20pm UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/10 "2015-09-03T14:20:08Z")

</div>

> [@bert003](#):
>
> Are you sure this works? ...

Sorry for the inconvenience, I have attached the mte file, which works for me.  
[Export.CMD.CreateTextfileForPublisher.mte](https://community.mp3tag.de/uploads/default/original/2X/f/fa8abccdf9b213239a63998d643b881e9f3095d3.mte) (213 Bytes)

DD.20150903.1820.CEST

[Export.CMD.CreateTextfileForPublisher.mte](https://community.mp3tag.de/uploads/default/original/2X/f/fa8abccdf9b213239a63998d643b881e9f3095d3.mte) (213 Bytes)

---

<div class="post-metadata">

**Author:** ![bert003](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/b5a626/32.png) [@bert003](https://community.mp3tag.de/u/bert003)\
**Post date:** [September 3, 2015, 5:23pm UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/11 "2015-09-03T17:23:36Z")

</div>

I learned a lot today 🙂

It almost works. In the Temp directory a file named CreateTextfileForPublisher.cmd is created.  
But it isn't executed so no publisher file in the album directory. If I launch it manually the publisher file is created and the CreateTextfileForPublisher.cmd file deletes itself, just as expected.

Looking how to get the cmd file executed automaticly.

/edit:  
If I do the export via the file menu the export ends wit a dialog box with a question if I want to view the export file. If I choose yes, the publisher file will be created in the album's directory. So answering yes triggers the .cmd file.

In an export _action_ such dialog box/question isn't shown, maybe the problem is there?

---

<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:25pm UTC](https://community.mp3tag.de/t/export-field-to-a-file/17199/12 "2026-02-09T12:25:51Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


