# Generate Playlists By Genre (Having Multiple Values)

**URL:** https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564
**Category:** Support
**Created:** [March 6, 2014, 9:56pm UTC](https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564 "2014-03-06T21:56:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![xavier.beltran](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@xavier.beltran](https://community.mp3tag.de/u/xavier.beltran)
#### Post date: [March 6, 2014, 9:56pm UTC](https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564/1 "2014-03-06T21:56:17Z")

</div>

Hi,

I use AMG to tag my files and therefore Genre can have multiple values.  
I use MP3Tag's \\ to separate the values and it works fine (I filter-checked it via "$meta")

I would like to simulate the following actions with a script/action/export, for instance:

- Filter: "$meta(GENRE,0)" IS "Folk" OR "$meta(GENRE,1)" IS "Folk" OR "$meta(GENRE,2)" IS "Folk" OR ...

- Menu-\>Playlist (all Files) with File Name: Folk.m3u

If I could iterate on all genres present in the File View (instead of specifying "Folk" or "Pop/Rock" etc.) that would even be better.

Any ideas?

Thanks

---

<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 7, 2014, 2:53am UTC](https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564/2 "2014-03-07T02:53:05Z")

</div>

> [@xavier](#):
>
> ... - Filter: "$meta(GENRE,0)" IS "Folk" OR "$meta(GENRE,1)" IS "Folk" OR "$meta(GENRE,2)" IS "Folk" OR ...

Possibly there is a simplification for the filter string ...  
GENRE HAS "Folk"  
This will find also "Rockfolk" or "Folk Rock".

> [@xavier](#):
>
> ... I would like to simulate the following actions with a script/action/export, ...for instance: ... - Menu-\>Playlist (all Files) with File Name: Folk.m3u ...

Hm, at first ... study how the Mp3tag export scripting language does work.

A simple m3u export script looks like this ...

**$filename('T:\TEST\PlayList.m3u.txt',ANSI)'#EXTM3U' $loop(%\_path%)'#EXTINF:'%\_length\_seconds%','%ARTIST%' - '%TITLE% %\_path% $loopend()**

... somewhat extended m3u8 ...

**1: $filename($getEnv('USERPROFILE')'\Desktop\Playlist.Genre.Artist.Title.m3u8.txt',UTF-8)$loop(%GENRE%)'#EXTM3U'** 

**2: '###GENRE='$if2(%GENRE%,'undefined')  
3: '###PLAYLIST=Playlist.Genre.'$if2(%GENRE%,'undefined')'.txt'  
4: $loop(%ARTIST%)$loop(%TITLE%)'#EXTINF:'%\_length\_seconds%','%ARTIST%' - '%TITLE%  
5: %\_path%  
6: $loopend()$loopend()  
7: '###'$repeat('-',20)' use text editor to split here '$repeat('-',20)  
8: $loopend()**

 

DD.20140307.0500.CET

---

<div class="post-metadata">

### Author: ![xavier.beltran](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@xavier.beltran](https://community.mp3tag.de/u/xavier.beltran)
#### Post date: [March 7, 2014, 4:30pm UTC](https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564/3 "2014-03-07T16:30:33Z")

</div>

DetlevD, many thanks for answering

(btw, I started using your Mp3tagExportSplitter mte & exe to start learning about the issues at hand)

Thanks for the filter simplification which works fine. Is there any way to filter with an action/script?

Tried your solution in the export file but it seems looping on %genre% does not loop on every instance of the genre multivalues and stops at the first (i.e. $meta("X",0))

---

<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 7, 2014, 5:02pm UTC](https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564/4 "2014-03-07T17:02:28Z")

</div>

> [@xavier](#):
>
> ... Tried your solution in the export file but it seems looping on %genre% does not loop on every instance of the genre multivalues and stops at the first (i.e. $meta("X",0))

Read there ...  
[/t/15566/1](https://community.mp3tag.de/t/15566/1)

DD.20140307.1902.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:24pm UTC](https://community.mp3tag.de/t/generate-playlists-by-genre-having-multiple-values/15564/5 "2026-02-09T12:24:57Z")

</div>


