# Get a list of all SOLOIST of an album

**URL:** https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917
**Category:** Export
**Created:** [January 10, 2012, 7:55pm UTC](https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917 "2012-01-10T19:55:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![LosMintos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@LosMintos](https://community.mp3tag.de/u/LosMintos)
#### Post date: [January 10, 2012, 7:55pm UTC](https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917/1 "2012-01-10T19:55:25Z")

</div>

Hi all,

another strange question from myside ![:rolleyes:](https://community.mp3tag.de/uploads/default/original/1X/3a79e8b0b7d169b30216785521d7c6f4f895c421.gif ":rolleyes:") ... consider an album where a couple of soloists are present (could also be artist or any other tag field). Some tracks don't have any soloist field; others have one or more soloist. A soloist's name can appear on more than one track. An example, four tracks:

```
TRACK=1
ALBUM=Tabula Rasa
TITLE=Fratres
SOLOIST=Gidon Kremer
SOLOIST=Keith Jarrett

TRACK=2
ALBUM=Tabula Rasa
TITLE=Cantus In Memory Of Benjamin Britten

TRACK=3
ALBUM=Tabula Rasa
TITLE=Fratres

TRACK=4
ALBUM=Tabula Rasa
TITLE=Tabula Rasa
SOLOIST=Alfred Schnittke
SOLOIST=Gidon Kremer
SOLOIST=Tatjana Grindenko

```

Now, I would like to get a list of all soloists present on that album, without dublicates. The example would led to:

```
Gidon Kremer, Keith Jarrett, Alfred Schnittke, Tatjana Grindenko

```

What I have so far, is

> [@](#):
>
> $put(s,$loop(%track%)$meta\_sep(soloist,'~')$if(%soloist%,'~',%DUMMY%)$loopend())

There I'm stucked. I don't know how to remove the dublicates and don't know how to put nice separator between the single names.

Could you help?

---

<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: [January 10, 2012, 8:50pm UTC](https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917/2 "2012-01-10T20:50:27Z")

</div>

> [@LosMintos](#):
>
> Hi all, ... Now, I would like to get a list of all soloists present on that album, without dublicates. ... Could you help?

Regarding removing duplicates from comma delimited string list, please read this thread ...  
[/t/10616/1](https://community.mp3tag.de/t/10616/1)

**$put(List,$loop(%TRACK%)$meta\_sep(SOLOIST,',')','$get(List)$loopend())**

... collects ...  
Alfred Schnittke,Gidon Kremer,Tatjana Grindenko  
Keith Jarrett,Gidon Kremer  
... to ...  
Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,Keith Jarrett,Gidon Kremer,

How to remove duplicate items, see mentioned thread.

DD.20120110.2308.CET

---

<div class="post-metadata">

### Author: ![LosMintos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@LosMintos](https://community.mp3tag.de/u/LosMintos)
#### Post date: [January 12, 2012, 5:52pm UTC](https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917/3 "2012-01-12T17:52:21Z")

</div>

Hi DetlevD,

I expected you to answer --- thank's a lot for your help and patience! However, ...

> [@DetlevD](#):
>
> Regarding removing duplicates from comma delimited string list, please read this thread ...  
> [/t/10616/1](https://community.mp3tag.de/t/10616/1)

The difference is, I'm dealing with an export script ... I don't have a tag field ready that contains the list. I have it in a variable ...

> [@DetlevD](#):
>
> **$put(List,$loop(%TRACK%)$meta\_sep(SOLOIST,',')','$get(List)$loopend())**
> 
> ... collects ...  
> Alfred Schnittke,Gidon Kremer,Tatjana Grindenko  
> Keith Jarrett,Gidon Kremer  
> ... to ...  
> Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,Keith Jarrett,Gidon Kremer,

One has to respect tracks without field SOLOIST. I get

```
Gidon Kremer,Keith Jarrett,,,Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,

```

Using

```
$put(s,','$loop(%track%)$meta_sep(soloist,',')$if(%soloist%,',',%DUMMY%)$loopend())

```

led to

```
,Gidon Kremer,Keith Jarrett,Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,

```

Now the problem. I don't know, how to come up with a solution, if possible. Using

```
$replace($put(s,','$loop(%track%)$meta_sep(soloist,',')$if(%soloist%,',',%DUMMY%)$loopend()),',','KOMMA')

```

gives

```
KOMMAGidon Kremer,Keith Jarrett,Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,

```

We see, the $replace() does not touch the content of variable "s".

As expected,

```
$regexp($put(s,','$loop(%track%)$meta_sep(soloist,',')$if(%soloist%,',',%DUMMY%)$loopend()),'(?:^|,)([^,]*)(.*)(,\1)+(?=,|$)',',$1$2')

```

does nothing and leaves the list unchanged.

Sidenote, inside the export script:

```
$regexp(',aaa,bbb,ccc,bbb,ddd,ccc,eee,fff,GGG,ggg,iii','(?:^|,)([^,]*)(.*)(,\1)+(?=,|$)',',$1$2')

```

works fine and removes the second ',bbb'.

With the other regexp from the linked thread, I got error messages.

So, the question is, how to manipulate the content of a variable (a string stored in a variable)? If possible at all ...

![:ph34r:](https://community.mp3tag.de/uploads/default/original/1X/d9d21e0e122fbe04cbaaa509828a996924771538.gif ":ph34r:")

---

<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: [January 12, 2012, 6:10pm UTC](https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917/4 "2012-01-12T18:10:44Z")

</div>

> [@LosMintos](#):
>
> Hi DetlevD, I expected you to answer --- thank's a lot for your help and patience! However, ... The difference is, I'm dealing with an export script ... I don't have a tag field ready that contains the list. I have it in a variable ...

$put, $puts, [$get] must be written on the 'highest script level'.  
These functions do not work when embedded into other functions of the Mp3tag export scripting language.  
Beside that I just discovered, that the functions $trim, $trimLeft, $trimRight do not work inside a $put function call.

DD.20120112.2012.CET

Edit.

As LosMintos has pointed out in his following post, my statement about the $get function was not quite right. In fact the $get function can be used within other scripting functions, what makes sense.

But the 'visibility' or 'usability' of functions within functions in the Mp3tag scripting language needs a review in general.

DD.20120112.2317.CET

---

<div class="post-metadata">

### Author: ![LosMintos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@LosMintos](https://community.mp3tag.de/u/LosMintos)
#### Post date: [January 12, 2012, 6:49pm UTC](https://community.mp3tag.de/t/get-a-list-of-all-soloist-of-an-album/12917/5 "2012-01-12T18:49:01Z")

</div>

> [@DetlevD](#):
>
> $put, $puts, $get must be written on the 'highest script level'.  
> These functions do not work when embedded into other functions of the Mp3tag export scripting language.

One can sum up stored values by

```
$put(r,$add($get(r1),$get(r2),$get(r3),$get(r4),$get(r5)))

```

where $get is inside $add. This works for me ...

By the way $replace($get(s), ..., ...) does not work.
