![]() ![]() |
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 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? |
|
|
|
Jan 10 2012, 22:50
Post
#2
|
|
![]() Member Group: Full Members Posts: 4129 Joined: 26-May 06 From: Wuppertal, Germany, Planet Earth Member No.: 3194 Mp3tag Version: 2.54 |
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 ♥ |
|
|
|
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, ... Regarding removing duplicates from comma delimited string list, please read this thread ... 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 ...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, 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 ... |
|
|
|
Jan 12 2012, 20:10
Post
#4
|
|
![]() Member Group: Full Members Posts: 4129 Joined: 26-May 06 From: Wuppertal, Germany, Planet Earth Member No.: 3194 Mp3tag Version: 2.54 |
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 ♥ |
|
|
|
Jan 12 2012, 20:49
Post
#5
|
|
|
Member Group: Full Members Posts: 88 Joined: 23-September 08 Member No.: 7617 Mp3tag Version: 2.51 |
$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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 13:06 |