IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Get a list of all SOLOIST of an album, varying SOLOIST per track, multivalue
LosMintos
post Jan 10 2012, 21:55
Post #1


Member


Group: Full Members
Posts: 88
Joined: 23-September 08
Member No.: 7617
Mp3tag Version: 2.51



Hi all,

another strange question from myside rolleyes.gif ... 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:
QUELLTEXT
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:
QUELLTEXT
Gidon Kremer, Keith Jarrett, Alfred Schnittke, Tatjana Grindenko


What I have so far, is
ZITAT
$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?
Go to the top of the page
 
+Quote Post
DetlevD
post Jan 10 2012, 22:50
Post #2


Member


Group: Full Members
Posts: 4863
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.62



QUOTE (LosMintos @ Jan 10 2012, 21:55) *
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 ...
http://forums.mp3tag.de/index.php?showtopic=11975

$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

This post has been edited by DetlevD: Jan 10 2012, 23:08


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
LosMintos
post Jan 12 2012, 19:52
Post #3


Member


Group: Full Members
Posts: 88
Joined: 23-September 08
Member No.: 7617
Mp3tag Version: 2.51



Hi DetlevD,

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

ZITAT(DetlevD @ Jan 10 2012, 22:50) *
Regarding removing duplicates from comma delimited string list, please read this thread ...
http://forums.mp3tag.de/index.php?showtopic=11975
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 ...

ZITAT(DetlevD @ Jan 10 2012, 22:50) *
$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
QUELLTEXT
Gidon Kremer,Keith Jarrett,,,Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,


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

led to
QUELLTEXT
,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
QUELLTEXT
$replace($put(s,','$loop(%track%)$meta_sep(soloist,',')$if(%soloist%,',',%DUMMY%)$loopend()),',','KOMMA')

gives
QUELLTEXT
KOMMAGidon Kremer,Keith Jarrett,Alfred Schnittke,Gidon Kremer,Tatjana Grindenko,

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

As expected,
QUELLTEXT
$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:
QUELLTEXT
$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.gif
Go to the top of the page
 
+Quote Post
DetlevD
post Jan 12 2012, 20:10
Post #4


Member


Group: Full Members
Posts: 4863
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.62



QUOTE (LosMintos @ Jan 12 2012, 19:52) *
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

This post has been edited by DetlevD: Jan 12 2012, 23:17


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
LosMintos
post Jan 12 2012, 20:49
Post #5


Member


Group: Full Members
Posts: 88
Joined: 23-September 08
Member No.: 7617
Mp3tag Version: 2.51



ZITAT(DetlevD @ Jan 12 2012, 20:10) *
$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
QUELLTEXT
$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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd August 2014 - 20:37