# Adding album file size and length totals

**URL:** https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869
**Category:** Support
**Created:** [July 2, 2014, 1:13am UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869 "2014-07-02T01:13:40Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![smugalugs](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@smugalugs](https://community.mp3tag.de/u/smugalugs)
#### Post date: [July 2, 2014, 1:13am UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/1 "2014-07-02T01:13:40Z")

</div>

I use MP3TAG almost exclusively for my audiobook collection. I currently export an RTF file with the following data to the book folder. As most of the books are split into multiple files I only extract from the first file however that makes the files size and length data irrelevant. Is there a way to add the totals of the .mp3 files within the folder to give an album/book size and length? I don't really know what I am doing but have figured out this much by trial and error.

$loop(%\_filename\_ext%)  
Book Title: \b %title%\b0\par  
Series: \b %album%\b0\par  
Author: \b %artist%\b0\par  
Narrator: \b %albumartist%\b0\par  
Year: \b %year%\b0\par  
Audio Publication: \b %origyear%\b0\par  
Genre: \b %genre%\b0\par  
Length: \b %\_length%\b0\par  
Size: \b %\_total\_size%\b0\par  
Bitrate: \b %\_bitrate% %\_vbr%\b0\par  
Sample Rate: \b %\_samplerate%\b0\par  
Type: \b %\_extension%\b0\par  
Codec: \b %\_codec% %\_tool%\b0\par  
Comment: \b %comment%\b0\par  
\par  
$loopend()

Regards

My apologies. Maybe I should have posted this in the Export subforum but I can't work out how to move the post??

---

<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: [July 2, 2014, 7:53am UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/2 "2014-07-02T07:53:04Z")

</div>

See this thread for %\_total\_time%  
[Album Length](https://community.mp3tag.de/t/3637/1)

---

<div class="post-metadata">

### Author: ![smugalugs](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@smugalugs](https://community.mp3tag.de/u/smugalugs)
#### Post date: [July 2, 2014, 9:00am UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/3 "2014-07-02T09:00:57Z")

</div>

Thanks a heap for the link. I managed to work out how to get total size and total time to work within the context of my export RTF however I can't work out how to make it limit to one entry. I see the (%fieldname%,num) but can't figure out how to use it in this context and end up with multiple entries when (as all tags are identical between the files except track #) I don't require the duplicates. Here is what I have. Any suggestions would be appreciated.

$loop(%\_folderpath%,1)$puts(album\_time,%\_total\_time%)$loopend()  
$loop(%\_folderpath%,1)$puts(album\_size,%\_total\_size%)$loopend()  
$loop(%\_filename\_ext%,1)  
Book Title: \b %title%\b0\par  
Series: \b %album%\b0\par  
Author: \b %artist%\b0\par  
Narrator: \b %albumartist%\b0\par  
Book Year: \b %year%\b0\par  
Audio Year: \b %origyear%\b0\par  
Genre: \b %genre%\b0\par  
Book Length: \b $get(album\_time)\b0\par  
Book Size: \b $get(album\_size)\b0\par  
Bitrate: \b %\_bitrate% %\_vbr%\b0\par  
Sample Rate: \b %\_samplerate%\b0\par  
Audio Type: \b %\_extension%\b0\par  
Audio Codec: \b %\_codec% %\_tool%\b0\par  
Comment: \b %comment%\b0\par  
\par  
$loopend()  
\par  
}

---

<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: [July 2, 2014, 9:34am UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/4 "2014-07-02T09:34:05Z")

</div>

are these $loop() ....

> [@smugalugs](#):
>
> $loop(%\_folderpath%,1)$puts(album\_time,%\_total\_time%)$loopend()  
> $loop(%\_folderpath%,1)$puts(album\_size,%\_total\_size%)$loopend()  
> -\> $loop(%\_filename\_ext%,1)  
> Book Title: \b %title%\b0\par  
> Series: \b %album%\b0\par  
> Author: \b %artist%\b0\par  
> Narrator: \b %albumartist%\b0\par  
> Book Year: \b %year%\b0\par  
> Audio Year: \b %origyear%\b0\par  
> Genre: \b %genre%\b0\par  
> Book Length: \b $get(album\_time)\b0\par  
> Book Size: \b $get(album\_size)\b0\par  
> Bitrate: \b %\_bitrate% %\_vbr%\b0\par  
> Sample Rate: \b %\_samplerate%\b0\par  
> Audio Type: \b %\_extension%\b0\par  
> Audio Codec: \b %\_codec% %\_tool%\b0\par  
> Comment: \b %comment%\b0\par  
> \par  
> -\> $loopend()  
> \par  
> }

really necessary, if you want to go through the data only once?

---

<div class="post-metadata">

### Author: ![smugalugs](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@smugalugs](https://community.mp3tag.de/u/smugalugs)
#### Post date: [July 2, 2014, 11:25am UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/5 "2014-07-02T11:25:12Z")

</div>

> [@ohrenkino](#):
>
> are these $loop() ....
> 
> really necessary, if you want to go through the data only once?

I have no idea. I created this by experimentation and borrowing from other examples. I have no idea how it actually works. I tried to use some logic but that only takes you so far. Reading the help file is somewhat helpful however I am coming from the place of a complete amateur.

---

<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: [July 2, 2014, 3:56pm UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/6 "2014-07-02T15:56:29Z")

</div>

> [@smugalugs](#):
>
> I have no idea. ...

Then please try to leave them out.

---

<div class="post-metadata">

### Author: ![smugalugs](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@smugalugs](https://community.mp3tag.de/u/smugalugs)
#### Post date: [July 2, 2014, 8:29pm UTC](https://community.mp3tag.de/t/adding-album-file-size-and-length-totals/15869/7 "2014-07-02T20:29:01Z")

</div>

> [@ohrenkino](#):
>
> Then please try to leave them out.

I'm not really sure what you are telling me to leave out because the export doesn't work when I delete the extra loop commands. I copied them from the example you linked to and they work. Are you saying they are causing the duplication?

EDIT: OK I get what you meant and got it working. Thanks

---

<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/adding-album-file-size-and-length-totals/15869/8 "2026-02-09T12:25:07Z")

</div>


