# Export script with artist count per album

**URL:** https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252
**Category:** Support
**Created:** [October 13, 2024, 4:21pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252 "2024-10-13T16:21:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bollemanneke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/74df32/32.png) [@bollemanneke](https://community.mp3tag.de/u/bollemanneke)
#### Post date: [October 13, 2024, 4:21pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/1 "2024-10-13T16:21:45Z")

</div>

Hi everyone,

Is it possible to generate a txt file with this information?

Line 1: album, albumartist, year.

Line two: artist name (number of tracks for that artist).

And this for my entire music folder.

So for instance:

Home Alone (John Williams, 2015)

John Williams (23), Mel Tormé (2).

Thank you!

---

<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: [October 13, 2024, 4:47pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/2 "2024-10-13T16:47:30Z")

</div>

Here is a quick and dirty attempt:

```auto
$filename(artistcount.txt,utf-8)
$loop(%album% %albumartist% %year%)%album%|%albumartist%|%year%
$loop(%artist%)$loopend()%artist%: %_total_files%
$loopend()

```

---

<div class="post-metadata">

### Author: ![bollemanneke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/74df32/32.png) [@bollemanneke](https://community.mp3tag.de/u/bollemanneke)
#### Post date: [October 13, 2024, 5:04pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/3 "2024-10-13T17:04:18Z")

</div>

That sort of works, but it does not return artists that differ from the album artist.

---

<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: [October 13, 2024, 5:37pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/4 "2024-10-13T17:37:44Z")

</div>

Try if this is better:

```auto
$filename(artistcount.txt,utf-8)
$loop(%album%)%album%|%albumartist%|%year%$loop(%albumartist%)
$loop(%artist%)$loop(%artist%,1)
$loopend()%artist%: %_total_files%$loopend()
$loopend()$loopend()

```

---

<div class="post-metadata">

### Author: ![bollemanneke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/74df32/32.png) [@bollemanneke](https://community.mp3tag.de/u/bollemanneke)
#### Post date: [October 13, 2024, 6:11pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/5 "2024-10-13T18:11:15Z")

</div>

Beautiful, thank you!

---

<div class="post-metadata">

### Author: ![bollemanneke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/74df32/32.png) [@bollemanneke](https://community.mp3tag.de/u/bollemanneke)
#### Post date: [October 14, 2024, 12:07pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/6 "2024-10-14T12:07:41Z")

</div>

One more question. Would there be a way to make this script work for albums that have different album artists? So in that case I'd like one album artist, then the artist count, then the second album artist, a new artist count etc.

---

<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: [October 14, 2024, 12:20pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/7 "2024-10-14T12:20:53Z")

</div>

You could add further sorting criteria in the first $loop() e.g.  
`$loop(%album% %albumartist%)`  
and see if you get the better results.

---

<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: [November 13, 2024, 12:20pm UTC](https://community.mp3tag.de/t/export-script-with-artist-count-per-album/66252/8 "2024-11-13T12:20:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
