# export %length\_minutes%?

**URL:** https://community.mp3tag.de/t/export-length-minutes/17771
**Category:** Support
**Created:** [March 19, 2016, 3:00pm UTC](https://community.mp3tag.de/t/export-length-minutes/17771 "2016-03-19T15:00:42Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![powerkutte](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/7c8e57/32.png) [@powerkutte](https://community.mp3tag.de/u/powerkutte)
#### Post date: [March 19, 2016, 3:00pm UTC](https://community.mp3tag.de/t/export-length-minutes/17771/1 "2016-03-19T15:00:42Z")

</div>

hi there, i made a simple export template:

```
$filename(Trackliste.txt,utf-8)
%album% 
$loop(%track%)$num(%track%,2) %title%
$loopend()%_length_seconds%

```

now i want to print "95 minutes" instead of "1:35:00" or "5700 seconds".  
how can i do some simple calculation? i only found about string functions...

thx in advance 🙂

---

<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: [March 19, 2016, 3:18pm UTC](https://community.mp3tag.de/t/export-length-minutes/17771/2 "2016-03-19T15:18:13Z")

</div>

> [@powerkutte](#):
>
> ... i want to print "95 minutes" instead of "1:35:00" or "5700 seconds". how can i do some simple calculation? ...

**Formatstring examples ... 1. $div(%\_length\_seconds%,60)' min and '$mod(%\_length\_seconds%,60)' sec' 2. $div(%\_length\_seconds%,60)' min'$ifgreater($mod(%\_length\_seconds%,60),0,' and '$mod(%\_length\_seconds%,60)' sec',) 3. $div(%\_length\_seconds%,60)':'$num($mod(%\_length\_seconds%,60),2)' min' 4. $div(%\_length\_seconds%,60)'.'$div($mod(%\_length\_seconds%,60)'000',60)' min' $div(%\_length\_seconds%,60)'.'$div($mul($mod(%\_length\_seconds%,60),1000),60)' min' Results ... %\_length\_seconds% = 395 1. '6 min and 35 sec' 2. '6 min and 35 sec' 3. '6:35 min' 4. '6.583 min' %\_length\_seconds% = 5700 1. '95 min and 0 sec' 2. '95 min' 3. '95:00 min' 4. '95.0 min'**

DD.20160320.1109.CET

---

<div class="post-metadata">

### Author: ![powerkutte](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/7c8e57/32.png) [@powerkutte](https://community.mp3tag.de/u/powerkutte)
#### Post date: [March 25, 2016, 9:50am UTC](https://community.mp3tag.de/t/export-length-minutes/17771/3 "2016-03-25T09:50:21Z")

</div>

thank you it works well.

but somehow i now messed up:  
i want the length of all Tracks but the export only gives me the length of the 1st Track.

all files are processed but %length% now has only the time of the first track...

i also tried to workaround by using $puts $get and $add but don't really understand the typo...

---

<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: [March 25, 2016, 11:25am UTC](https://community.mp3tag.de/t/export-length-minutes/17771/4 "2016-03-25T11:25:13Z")

</div>

> [@powerkutte](#):
>
> ... i want the length of all Tracks but the export only gives me the length of the 1st Track ...

Export Mp3tag Global Placeholders

 **$filename($getEnv('TEMP')'\Test.txt',ANSI)'Mp3tag version: '%\_app% 'Following values are provided without a previous "loop/loopend" structure.' 'Total number of files (%''\_total\_files''%): '%\_total\_files% 'Total file size (formatted output) (%''\_total\_size''%): '%\_total\_size% 'Total file size in bytes (%''\_total\_size\_raw''%): '%\_total\_size\_raw% 'Total playing time (formatted output) (%''\_total\_time''%): '%\_total\_time% 'Total playing time (formatted output without days) (%''\_total\_time2''%): '%\_total\_time2% 'Total playing time in seconds (%''\_total\_time\_raw''%): '%\_total\_time\_raw%**

DD.20160325.1326.CET

---

<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: [March 25, 2016, 11:51am UTC](https://community.mp3tag.de/t/export-length-minutes/17771/5 "2016-03-25T11:51:57Z")

</div>

> [@powerkutte](#):
>
> ... all files are processed but %length% now has only the time of the first track... i also tried to workaround by using $puts $get and $add but don't really understand the typo...

Example export script, returns for one album a tracklist ordered by CD ...

**1: $filename($getEnv('USERPROFILE')'\Desktop\'$validate(%ARTIST%'.'%ALBUM%'.Tracklist.txt',),UTF-16)** 

**2: %ARTIST%' - '%ALBUM%' - '%YEAR%  
3:  
4: $loop(%DISCNUMBER%)'CD '%DISCNUMBER%  
5: $puts(my\_Counter,0)$loop(%\_filename%)$num($put(my\_Counter,$add($get(my\_Counter),1)),2)'.'$char(9)%TITLE%$char(9)%\_length%  
6: $loopend()'---'$char(9)'Gesamtdauer'$char(9)%\_total\_time2%  
7:  
8: $loopend()**

 

DD.20160325.1351.CET

---

<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:26pm UTC](https://community.mp3tag.de/t/export-length-minutes/17771/6 "2026-02-09T12:26:09Z")

</div>


