Get a list of all SOLOIST of an album

Hi all,

another strange question from myside :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

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?

Regarding removing duplicates from comma delimited string list, please read this thread ...
/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

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 ...

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:

$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

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.