# Create formated info.txt for entire Album

**URL:** <https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496>\
**Category:** Export\
**Created:** [February 27, 2013, 8:23am UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496 "2013-02-27T08:23:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicissuper](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@musicissuper](https://community.mp3tag.de/u/musicissuper)\
**Post date:** [February 27, 2013, 8:23am UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/1 "2013-02-27T08:23:25Z")

</div>

Hello Guys,

I am working on trying to create a formatted text file from my FLAC files that I can store with them for sorting later on. This is the export script I have at the moment:

```
$filename(Info2.nfo,ansi)-------------------------------------------------------------------------
%artist% - %album%
-------------------------------------------------------------------------

Artist.............: %artist%
Album..............: %album%
Genre..............: %genre%
Style..............: %style%
Year...............: %year%

--------------------
    Release Info
--------------------

Record Label.......: %publisher%
Catalog Number.....: %catalog%
Release Date.......: %releasedate%
Release Type.......: %releasetype%
Release Country....: %country%

--------------------
 Rip Specifications
--------------------

Codec..............: %_codec%
Average Bitrate....: $loop(%_filename_ext%)$puts(Vbitrate,$add($get(Vbitrate),%_bitrate%))$puts(cnt1,$add($get(cnt1),1))$loopend()$div($get(Vbitrate),$get(cnt1)) kbps %_vbr%
Channels...........: %_samplerate% khz / %_mode%[
Tags...............: %_tag%

-------------------------------------------------------------------------
                            Tracklisting
-------------------------------------------------------------------------

$loop($num(%discnumber%,3)$num(%track%,4)%_filename_ext%)$num(%track%,2). %title%$repeat( ,$sub(57,$len(%title%))) [$replace(%_length%,_,:)]
$loopend()

Playtime..........: %_total_time%
Total Size........: %_total_size%

-------------------------------------------------------------------------
                                Review
-------------------------------------------------------------------------

From 
by

-------------------------------------------------------------------------

```

However, whenever I run it, I get a [SYNTAX ERROR IN FORMATTING STRING]. Do you guys have any ideas as to why this may be happening?

Thanks for your help, I really appreciate it.

Oh, and one other thing. For the track listing, I am trying to format it as follows:

```
TT Artist - Track [00:00]
TT Artist - Track 2 [00:00]

```

With the track length formatted to the right. Is this possible?

Again, thank you so much.

-MIS

---

<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 27, 2013, 8:43am UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/2 "2013-02-27T08:43:49Z")

</div>

In this line remove the [ at the end:

Channels...........: %\_samplerate% khz / %\_mode%**[**

---

<div class="post-metadata">

**Author:** ![musicissuper](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@musicissuper](https://community.mp3tag.de/u/musicissuper)\
**Post date:** [February 27, 2013, 5:11pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/3 "2013-02-27T17:11:43Z")

</div>

That worked, thank you!

Now on to the more difficult one. I catalog all of my rips on a personal forum on my homeserver, formatted in BBCode. I am hoping that I can do a similar type export from MP3Tag, but I am getting the same syntax error as above.

Here is my export script:

```
$filename(Des.txt,ansi)
[center]
[b][size=20]%artist% [color=red]-[/color] %album% [color=orange]([/color][color=grey]%year%[/color][color=orange])[/color][/size][/b]
[br]
[img]folder.jpg[/img]
[br]
[b][u][size=14]Release Info[/size][/u][/b]
[size=10]
[b][color=orange]([/color][color=grey]Album[/color][color=orange])[/color] Artist [color=red]::[/color][/b] %artist%
[b]Album [color=red]::[/color][/b] %album%
[b]Genre [color=red]::[/color][/b] %genre%
[b]Style [color=red]::[/color][/b] %style%
[b]Source [color=red]::[/color][/b] %mediatype%
[b]Year [color=red]::[/color][/b] %year%
[br]
[b]Record Label [color=red]::[/color][/b] %publisher%
[b]Catalog Number [color=red]::[/color][/b] %catalog%
[b]Release Date [color=red]::[/color][/b] %releasedate%
[b]Release Type [color=red]::[/color][/b] %releasetype%
[b]Release Country [color=red]::[/color][/b] %country%
[/size]
[br][br]
[b][u][size=14]Tracklisting[/size][/u][/b]
[size=10]
$loop($num(%discnumber%,3)$num(%track%,4)%_filename_ext%)[color=grey]$num(%track%,2) [/color][color=red]- [/color]%title [color=orange]([/color][color=grey][$replace(%_length%,_,:)][/color][color=orange])[/color]
$loopend()
[/size]
[br][br]
[quote=Review from XXX by XXX]
[/quote]
[br][br]
[b][u][size=14]Release Notes[/size][/u][/b]
[size=10]
[color=red]- [/color]Ripped from original CD using XLD Version 20130127 (142.3)
[color=red]- [/color]High Res scans provided when available (Usually only the CDs)
[color=red]- [/color]Included Tags, Spectrograph, and Frequency Analysis charts provided
[/size]
[br]
[b][u][size=14]Included Tags[/size][/u][/b]
[br]
[img]Included-Tags.jpg[/img]
[br][br]
[b][u][size=14]Spectrograph Analysis[/size][/u][/b]
[br]
[img]Spectral-Analysis.jpg[/img]
[br][br]
[b][u][size=14]Frequency Analysis[/size][/u][/b]
[br]
[img]Frequency-Analysis.jpg[/img]
[br]
[/center]

```

Do you see anything wrong here? I am thinking that it has something to do with all the square brackets. Do I need to escape them somehow for it to export properly?

---

<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 27, 2013, 5:31pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/4 "2013-02-27T17:31:26Z")

</div>

Yes, they must be escaped.  
Here's how you can do it:

```
$filename(Des.txt,ansi)
'[center]'
'[b][size=20]'%artist% '[color=red]-[/color]' %album% '[color=orange]([/color][color=grey]'%year%'[/color][color=orange])[/color][/size][/b]'
'[br]'

```

Please also look in the help file for more information.

---

<div class="post-metadata">

**Author:** ![musicissuper](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@musicissuper](https://community.mp3tag.de/u/musicissuper)\
**Post date:** [February 28, 2013, 5:00pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/5 "2013-02-28T17:00:08Z")

</div>

Hey dano,

I've done the escaping and am still getting the same error message. Can you see anything wrong with the following script?

```
$filename(Des.txt,ansi)
'[b][size=20]'%artist% '[color=red]-[/color]' %album% '[color=orange]([/color][color=grey]'%year%'[/color][color=orange])[/color][/size][/b]'
'[br]'
'[img]folder.jpg[/img]'
'[br]'
'[b][u][size=14]Release Info[/size][/u][/b]'
'[size=10]'
'[b][color=orange]([/color][color=grey]Album[/color][color=orange])[/color] Artist [color=red]::[/color][/b]' %artist%
'[b]Album [color=red]::[/color][/b]' %album%
'[b]Genre [color=red]::[/color][/b]' %genre%
'[b]Style [color=red]::[/color][/b]' %style%
'[b]Source [color=red]::[/color][/b]' %mediatype%
'[b]Year [color=red]::[/color][/b]' %year%
'[br]'
'[b]Record Label [color=red]::[/color][/b]' %publisher%
'[b]Catalog Number [color=red]::[/color][/b]' %catalog%
'[b]Release Date [color=red]::[/color][/b]' %releasedate%
'[b]Release Type [color=red]::[/color][/b]' %releasetype%
'[b]Release Country [color=red]::[/color][/b]' %country%
'[/size]'
'[br][br]'
'[b][u][size=14]Tracklisting[/size][/u][/b]'
'[size=10]'
$loop('[color=grey]'$num(%track%,2) '[/color][color=red]- [/color]'%title '[color=orange]([/color][color=grey]'[$replace(%_length%,_,:)]'[/color][color=orange])[/color]'
$loopend()
'[/size]'
'[br][br]'
'[quote=Review from XXX by XXX]'
'[/quote]'
'[br][br]'
'[b][u][size=14]Release Notes[/size][/u][/b]'
'[size=10]'
'[color=red]- [/color]Ripped from original CD using XLD Version 20130127 (142.3)'
'[color=red]- [/color]High Res scans provided when available (Usually only the CDs)'
'[color=red]- [/color]Included Tags, Spectrograph, and Frequency Analysis charts provided'
'[/size]'
'[br]'
'[b][u][size=14]Included Tags[/size][/u][/b]'
'[br]'
'[img]Included-Tags.jpg[/img]'
'[br][br]'
'[b][u][size=14]Spectrograph Analysis[/size][/u][/b]'
'[br]'
'[img]Spectral-Analysis.jpg[/img]'
'[br][br]'
'[b][u][size=14]Frequency Analysis[/size][/u][/b]'
'[br]'
'[img]Frequency-Analysis.jpg[/img]'

```

Thanks for your continued help, dano, it's very much appreciated.

---

<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 28, 2013, 5:59pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/6 "2013-02-28T17:59:30Z")

</div>

You messed up the $loop part

```
$filename(Des.txt,ansi)
'[b][size=20]'%artist% '[color=red]-[/color]' %album% '[color=orange]([/color][color=grey]'%year%'[/color][color=orange])[/color][/size][/b]'
'[br]'
'[img]folder.jpg[/img]'
'[br]'
'[b][u][size=14]Release Info[/size][/u][/b]'
'[size=10]'
'[b][color=orange]([/color][color=grey]Album[/color][color=orange])[/color] Artist [color=red]::[/color][/b]' %artist%
'[b]Album [color=red]::[/color][/b]' %album%
'[b]Genre [color=red]::[/color][/b]' %genre%
'[b]Style [color=red]::[/color][/b]' %style%
'[b]Source [color=red]::[/color][/b]' %mediatype%
'[b]Year [color=red]::[/color][/b]' %year%
'[br]'
'[b]Record Label [color=red]::[/color][/b]' %publisher%
'[b]Catalog Number [color=red]::[/color][/b]' %catalog%
'[b]Release Date [color=red]::[/color][/b]' %releasedate%
'[b]Release Type [color=red]::[/color][/b]' %releasetype%
'[b]Release Country [color=red]::[/color][/b]' %country%
'[/size]'
'[br][br]'
'[b][u][size=14]Tracklisting[/size][/u][/b]'
'[size=10]'
$loop($num(%discnumber%,3)$num(%track%,4)%_filename_ext%)'[color=grey]'$num(%track%,2) '[/color][color=red]- [/color]'%title% '[color=orange]([/color][color=grey]'[$replace(%_length%,_,:)]'[/color][color=orange])[/color]'
$loopend()
'[/size]'
'[br][br]'
'[quote=Review from XXX by XXX]'
'[/quote]'
'[br][br]'
'[b][u][size=14]Release Notes[/size][/u][/b]'
'[size=10]'
'[color=red]- [/color]Ripped from original CD using XLD Version 20130127 (142.3)'
'[color=red]- [/color]High Res scans provided when available (Usually only the CDs)'
'[color=red]- [/color]Included Tags, Spectrograph, and Frequency Analysis charts provided'
'[/size]'
'[br]'
'[b][u][size=14]Included Tags[/size][/u][/b]'
'[br]'
'[img]Included-Tags.jpg[/img]'
'[br][br]'
'[b][u][size=14]Spectrograph Analysis[/size][/u][/b]'
'[br]'
'[img]Spectral-Analysis.jpg[/img]'
'[br][br]'
'[b][u][size=14]Frequency Analysis[/size][/u][/b]'
'[br]'
'[img]Frequency-Analysis.jpg[/img]'
```

---

<div class="post-metadata">

**Author:** ![musicissuper](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@musicissuper](https://community.mp3tag.de/u/musicissuper)\
**Post date:** [February 28, 2013, 6:17pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/7 "2013-02-28T18:17:16Z")

</div>

Awesome!!! Thank you so much, dano, you are a life saver!

---

<div class="post-metadata">

**Author:** ![musicissuper](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@musicissuper](https://community.mp3tag.de/u/musicissuper)\
**Post date:** [March 24, 2013, 4:49pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/8 "2013-03-24T16:49:42Z")

</div>

I have one additional question about this edited text file export. I hope you guys can help.

Is there way to conditionally export a tag field only if it is populated/non-empty?

I want to include a tag field that is non-standard across my library, but only a few of my releases contain it. I'd like to have just one export script for everything as there may be a few of these optional tags.

Something like

IF(tag exists, export this)

Does something like this exist?

Thanks in advance!

-MusicIsSuper

---

<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 24, 2013, 5:27pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/9 "2013-03-24T17:27:02Z")

</div>

Yes it's simple:  
$if(%tagfield%,yes,no)

---

<div class="post-metadata">

**Author:** ![musicissuper](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@musicissuper](https://community.mp3tag.de/u/musicissuper)\
**Post date:** [March 24, 2013, 5:31pm UTC](https://community.mp3tag.de/t/create-formated-info-txt-for-entire-album/14496/10 "2013-03-24T17:31:43Z")

</div>

Cool! Thanks dano, much appreciated.
