# Amend export code to include total number of title entries.

**URL:** <https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277>\
**Category:** Support\
**Created:** [August 26, 2017, 3:33pm UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277 "2017-08-26T15:33:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seasider](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Seasider](https://community.mp3tag.de/u/Seasider)\
**Post date:** [August 26, 2017, 3:33pm UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277/1 "2017-08-26T15:33:08Z")

</div>

Hello,

```
      I was very kindly helped to export a list of artists in my one folder music library:

```

$loop(%ARTIST%,1)$num(%\_counter%,3)': '$if(%ARTIST%,$meta\_sep(ARTIST,$char(13)$char(10)$repeat($char(32),5)),)  
$loopend()

Is there anyone clever enough to amend this so that it also displays a total of the the number of titles by each artist after their entry please?

For example:

from

012: ABBA  
013: ABC  
014: AC/DC  
015: Ace  
016: Ace of Base

to

012: ABBA (46)  
013: ABC (5)  
014: AC/DC (5)  
015: Ace (1)  
016: Ace of Base (4)

Thanks to anyone who can help.

---

<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:** [August 26, 2017, 4:01pm UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277/2 "2017-08-26T16:01:02Z")

</div>

Try

```
$loop(%ARTIST%,1)$num(%_counter%,3)': '$if(%ARTIST%,$meta_sep(ARTIST,$char(13)$char(10)$repeat($char(32),5)),)$loop(%title%)$loopend() (%_max_counter%)
$loopend()
```

---

<div class="post-metadata">

**Author:** ![Seasider](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Seasider](https://community.mp3tag.de/u/Seasider)\
**Post date:** [August 26, 2017, 5:00pm UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277/3 "2017-08-26T17:00:13Z")

</div>

QUOTE (ohrenkino @ Aug 26 2017, 19:01) \<{POST\_SNAPBACK}\>

Try

```
$loop(%ARTIST%,1)$num(%_counter%,3)': '$if(%ARTIST%,$meta_sep(ARTIST,$char(13)$char(10)$repeat($char(32),5)),)$loop(%title%)$loopend() (%_max_counter%)
$loopend()<!--QuoteEnd--></div><!--QuoteEEnd-->

```

That's fantastic thankyou - much appreciated.

---

<div class="post-metadata">

**Author:** ![Seasider](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Seasider](https://community.mp3tag.de/u/Seasider)\
**Post date:** [August 27, 2017, 5:04am UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277/4 "2017-08-27T05:04:56Z")

</div>

Actually, can I take advantage of your expertise and good nature to ask a further question please?

Is it possible to get the program to display the results, putting those artists with highest number of titles first, that is (x) descending?

Thanks again.

---

<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:** [August 27, 2017, 6:40am UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277/5 "2017-08-27T06:40:11Z")

</div>

I think that this is not possible.  
The value for the (maximum) number of counts is calculated at the end of the previous loop (here: counting titles).  
If the next loop starts to count the next amount of titles, the counter is reset, the value is gone.  
So I would have to store the value for counts somewhere and then, when all artists and titles have been looped through, one would have to loop through all the saved counters and sort them.

But I do not see any possibility to create a list of unknown extent to save the individual counters.

If you want to have different sort criteria, I would create some kind of table with the export and use that export then in another program that can sort by columns.  
You could modify the export so that in the resulting file you get the columns separated by the TAB character:  
012: ABBA (46) -\> 012$char(9)ABBA$char(9)46

---

<div class="post-metadata">

**Author:** ![Seasider](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@Seasider](https://community.mp3tag.de/u/Seasider)\
**Post date:** [August 27, 2017, 2:42pm UTC](https://community.mp3tag.de/t/amend-export-code-to-include-total-number-of-title-entries/19277/6 "2017-08-27T14:42:29Z")

</div>

> [@ohrenkino](#):
>
> I think that this is not possible.  
> The value for the (maximum) number of counts is calculated at the end of the previous loop (here: counting titles).  
> If the next loop starts to count the next amount of titles, the counter is reset, the value is gone.  
> So I would have to store the value for counts somewhere and then, when all artists and titles have been looped through, one would have to loop through all the saved counters and sort them.
> 
> But I do not see any possibility to create a list of unknown extent to save the individual counters.
> 
> If you want to have different sort criteria, I would create some kind of table with the export and use that export then in another program that can sort by columns.  
> You could modify the export so that in the resulting file you get the columns separated by the TAB character:  
> 012: ABBA (46) -\> 012$char(9)ABBA$char(9)46

Again, Thankyou very much.

---

<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/amend-export-code-to-include-total-number-of-title-entries/19277/7 "2026-02-09T12:26:58Z")

</div>


