# Output "Various Artist" When There Is More Than 1 Artist

**URL:** <https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091>\
**Category:** Support\
**Created:** [August 17, 2021, 3:15pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091 "2021-08-17T15:15:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASSASSIN21](https://community.mp3tag.de/user_avatar/community.mp3tag.de/assassin21/32/8058_2.png) [@ASSASSIN21](https://community.mp3tag.de/u/ASSASSIN21)\
**Post date:** [August 17, 2021, 3:15pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/1 "2021-08-17T15:15:57Z")

</div>

Hi,  
My current export is

> **Export**
>
> '[size=4]Tracklist:[/size]'  
> $loop(%discnumber%)'[size=4]Disc '%discnumber% (%\_total\_time%)'[/size]'  
> $loop(%dummy%)''$num(%track%,2)' '$trim($regexp(%artist%,'(,_)\s_([^,]+[^,\s])','$1 [artist]$2[/artist]'))' - '%title%' i[/i]'  
> $loopend()$loopend()

So when there is a Track with Artist 1, Artist 2, Artist 3...etc it will look like this:

1. Artist 1, Artist 2, Artist 3, – Track Name (Duration)

I want it to replace (Artist 1, Artist 2, Artist 3) to Various Artists so it would look like this

1. Various Artists – Track Name (Duration)

---

<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 17, 2021, 5:04pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/2 "2021-08-17T17:04:17Z")

</div>

It looks to me like the code is not complete.  
If the string that you generate for several artists contains a comma, then you could use that to trigger the "Various Artists".

I wonder how that should work for groups that consist of several names anyway (like Earth, Wind & Fire; Emerson, Lake & Palmer) - will they also be condensed to "Various artists"?

---

<div class="post-metadata">

**Author:** ![ASSASSIN21](https://community.mp3tag.de/user_avatar/community.mp3tag.de/assassin21/32/8058_2.png) [@ASSASSIN21](https://community.mp3tag.de/u/ASSASSIN21)\
**Post date:** [August 17, 2021, 7:16pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/3 "2021-08-17T19:16:17Z")

</div>

Yeah, I snipped only the tracklist portion for the problem at hand, below is the complete code for reference:

> **Export**
>
> $filename(%\_folderpath%%album%.txt,utf-8)'[size=2]Album: '%album%'[/size]'  
> ['Release Date: '%year%]  
> 'Genre: '$trim($regexp(%genre%,'(,_)\s_([^,]+[^,\s])','$1 ['$2'](https://URL?taglist='$regexp(%genre%,\s+,.)')'))  
> 'Total Length: '%\_total\_time%
> 
> '[size=4]Tracklist:[/size]'  
> $loop(%discnumber%)'[size=4]Disc '%discnumber% (%\_total\_time%)'[/size]'  
> $loop(%dummy%)''$num(%track%,2)' '$trim($regexp(%artist%,'(,_)\s_([^,]+[^,\s])','$1 [artist]$2[/artist]'))' - '%title%' i[/i]'  
> $loopend()$loopend()  
> '[url=URL] ![]() [url=URL] ![]()'

> [@ohrenkino](#):
>
> If the string that you generate for several artists contains a comma, then you could use that to trigger the "Various Artists".

How's that can be done in code? I am still newbie ^^

> [@ohrenkino](#):
>
> I wonder how that should work for groups that consist of several names anyway (like Earth, Wind & Fire; Emerson, Lake & Palmer) - will they also be condensed to "Various artists"?

I use Export mainly for Soundtracks albums so it's not problem for me

---

<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 17, 2021, 7:25pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/4 "2021-08-17T19:25:28Z")

</div>

> [@ASSASSIN21](#):
>
> Yeah, I snipped only the tracklist portion

No, I mean that the code representation is not complete.

> [@ASSASSIN21](#):
>
> $regexp(%artist%,'(,_)\s_([^,]+[^,\s])','$1 [artist]$2[/artist]'))'

seems to be missing a number of repetition actors lik `*` or `+`.  
Anyway: the whole part looks to me like it laboriously splits the data in ARTIST but as far as I understand you, you do not need this as you either want the data in ARTIST as it is or, if there is a comma in the data, you want to see "Various Artists" - is this so?

---

<div class="post-metadata">

**Author:** ![ASSASSIN21](https://community.mp3tag.de/user_avatar/community.mp3tag.de/assassin21/32/8058_2.png) [@ASSASSIN21](https://community.mp3tag.de/u/ASSASSIN21)\
**Post date:** [August 17, 2021, 7:40pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/5 "2021-08-17T19:40:38Z")

</div>

Oh,  
Yes but to be sure I want it for tracks that has only 1 Artists to outputs it normally  
but for tracks that has a comma (multiple artists) it outputs Various Artists

---

<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 17, 2021, 7:55pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/6 "2021-08-17T19:55:45Z")

</div>

What about:  
`$ifgreater($strstr(%artist%,','),0,Various Artists,%artist%)`

---

<div class="post-metadata">

**Author:** ![ASSASSIN21](https://community.mp3tag.de/user_avatar/community.mp3tag.de/assassin21/32/8058_2.png) [@ASSASSIN21](https://community.mp3tag.de/u/ASSASSIN21)\
**Post date:** [August 17, 2021, 11:17pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/7 "2021-08-17T23:17:44Z")

</div>

Thanks, it worked! but now it overlaps with the %artist% tag code below

> **Export**
>
> $loop(%dummy%)''$num(%track%,2)' '$trim($regexp(%artist%,'(,_)\s_ ([^,]+[^,\s])','$1 [artist]$2[/artist]'))' - '%title%' i[/i]'

just FYI this output Artist name as a clickable link

---

<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 18, 2021, 6:15am UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/8 "2021-08-18T06:15:25Z")

</div>

What is the difference between this

> [@ASSASSIN21](#):
>
> $loop(%dummy%)''$num(%track%,2)' '$trim($regexp(%artist%,'(,_)\s_([^,]+[^,\s])','$1 [artist]$2[/artist]'))' - '%title%' i[/i]'

and this:

> [@ASSASSIN21](#):
>
> $loop(%dummy%)''$num(%track%,2)' '$trim($regexp(%artist%,'(,_)\s_ ([^,]+[^,\s])','$1 [artist]$2[/artist]'))' - '%title%' i[/i]'

and where did you insert my suggestion?

---

<div class="post-metadata">

**Author:** ![ASSASSIN21](https://community.mp3tag.de/user_avatar/community.mp3tag.de/assassin21/32/8058_2.png) [@ASSASSIN21](https://community.mp3tag.de/u/ASSASSIN21)\
**Post date:** [August 18, 2021, 1:07pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/9 "2021-08-18T13:07:59Z")

</div>

It's the same, just to point the problematic portion.

I insert it here

> **Code**
>
> '[size=4]Tracklist:[/size]'  
> $loop(%discnumber%)'[size=4]Disc '%discnumber% (%\_total\_time%)'[/size]'  
> $loop(%dummy%)''$num(%track%,2)' '$trim($ifgreater($strstr(%artist%,'、'),0,Various Artists,%artist%))' - '%title%' i[/i]'  
> $loopend()$loopend()

and the output is fine, but I don't know where to put this tag [artist] which makes the artist name a clickable link without getting syntax error

here is the a summary picture

 ![Capture](https://community.mp3tag.de/uploads/default/original/2X/3/32406e134bcb6bcba4ad9f865261ee0483a4947f.png)

---

<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 18, 2021, 4:41pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/10 "2021-08-18T16:41:08Z")

</div>

> [@ASSASSIN21](#):
>
> but I don't know where to put this tag [artist] which makes the artist name a clickable link without getting syntax error

Where did you get the code?  
Did it work ever at all?  
How and where do you get the target information to where the link should lead?  
What syntax have you tried before?

---

<div class="post-metadata">

**Author:** ![ASSASSIN21](https://community.mp3tag.de/user_avatar/community.mp3tag.de/assassin21/32/8058_2.png) [@ASSASSIN21](https://community.mp3tag.de/u/ASSASSIN21)\
**Post date:** [August 18, 2021, 10:24pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/11 "2021-08-18T22:24:12Z")

</div>

> [@ohrenkino](#):
>
> Where did you get the code?  
> Did it work ever at all?  
> How and where do you get the target information to where the link should lead?  
> What syntax have you tried before?

I didn't, I mixed and matched until I got the result I wanted and yeah it did work  
it's a site integration that just points that the text inside the artist tag is an artist.

Anyway, I figured what the problem was,

the first artist tag was inside parentheses syntax so it was working with the quotation marks like below

> **Original Code**
>
> $trim($regexp(%artist%,'(,_)\s_([^,]+[^,\s])','$1 [artist]$2'))'[/artist]

but without the parentheses I didn't need the quotation marks so when I removed them the tag text appeared again like below

> **Current Code**
>
> [artist] '$trim($ifgreater($strstr(%artist%,'、'),0,Various Artists,%artist%))'[/artist]

Sorry for the somewhat confusing matter but you did help me with the code I was looking for and thus reach the solution!

---

<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:** [September 17, 2021, 10:24pm UTC](https://community.mp3tag.de/t/output-various-artist-when-there-is-more-than-1-artist/54091/12 "2021-09-17T22:24:49Z")

</div>

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