Help - Search - Members - Calendar
Full Version: How to allign track lenght during nfo export
Mp3tag Forums > Mp3tag - International > Development > Export
thetie
Hi, if anyone could help me with this little coding problem Id be extremly greatful...

When exporting to nfo Id like the track length info (%_length%) to be alligned vertically.

Ive been looking into how Dano does this in his nfo code, but i cant figure it out. Dano's script lacks artist info (there is only "track no. - track title - track length"). I really need artist (%artist%) to be included since I have alot of VA albums.

This is the standard code i use: (Currently I always need to manually allign all the %_length% after export...)
CODE
$loop(%_path%)%track%.  %artist% - %title%  %_length%
$loopend()


This is how i want it to look:
CODE
Tracklisting:                                        Time:
01.  Artist A - Track A                              01:00
02.  Artist B - Track B                              02:37
03.  Artist C - Track C                              05:26
04.  Artist D - Track D                              05:31
05.  Artist E - Track E                              02:58
06.  Artist F - Track F                              07:31
07.  Artist G - Track G                              03:30
08.  Artist H - Track H                              07:40

                                           Total: 00:42:31


Thanks for any help! (sorry for my lack of knowledge how to do this)
newser
Try this:
QUELLTEXT
$loop(%_path%)%track%.  %artist% - %title%$repeat( ,$sub(60,$len(%artist% - %title%)))%_length%
$loopend()



thetie
Ah! Thx a million! biggrin.gif
thetie
Sorry if Im pushing my luck here (please forgive me)...
but is it possible to add a line break when the number of character in %artist% plus %title% reaches the defined placement of %_length%? So that the rest of the track title continues on the next line?

(On second thought that probably would be difficult, both because it would need the the correct spacing on next line as well as track title needs to break at a whole word not just the number of characters that reaches the limit...) Is it possible? :S

CODE
Tracklisting:                                        Time:
01.  Artist A - Track A                              01:00
02.  Artist B - Track B with a Really Really Really  02:37
     Long Track Name
03.  Artist C - Track C                              05:26
newser
v1:
QUELLTEXT
$loop(%_path%)$num(%track%,2).  $left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60))))
$loopend()


v2 (No empty lines):
QUELLTEXT
$loop(%_path%)$loop(%_path%)$num(%track%,2).  $iflonger(%artist% - %title%,60,$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60)))),$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60)))))
$loopend()
thetie
Wow thank you smile.gif

One problem though, i get non-matching no. of loop/loopends on both versions...

I just cannot get my head around how to close them. Final help? smile.gif
newser
Sorry. Now it should work.

v1:
QUELLTEXT
$loop(%_path%)$num(%track%,2).  $left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))%_length%
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60))))
$loopend()


v2 (No empty lines):
QUELLTEXT
$loop(%_path%)$num(%track%,2).  $iflonger(%artist% - %title%,60,$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))%_length%
     $mid(%artist% - %title%,61,60)  $repeat( ,$sub(60,$len($mid(%artist% - %title%,61,60)))),$left(%artist% - %title%,60)  $repeat( ,$sub(60,$len($left(%artist% - %title%,60))))%_length%)
$loopend()

thetie
Perfect!!! Thank you so much newser! smile.gif smile.gif This will same me so much time in the future! Thank you again!
painorozi
book.gif book.gif

Thank you so much rolleyes.gif laugh.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.