Create formated info.txt for entire Album

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

In this line remove the [ at the end:

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

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?

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.

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.

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]'

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

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

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

Cool! Thanks dano, much appreciated.