INTERACT FORUM
More => Old Versions => Media Center 16 (Development Ended) => Topic started by: AndyU on October 10, 2011, 10:37:22 am
-
Hi
I have many classical albums which I have, for historical reasons, tagged the [Name] fjeld as "Composer Work ..". For example, "Beethoven Sympohny No 3". Now I use J River and can show the Composer separately, I'd like to remove or hide the first word of each Title.
I can't find a function that will let me do that - I would like an 'INSTR' one that returned the position of the first space character in a text string so that I could then take the right hand portion of that field.
Any ideas?
-
Hi again,
Now we need the Regex() MC expression. Try something like this:
Regex([Name],/#^.*? (.*)#/,1)
-
Thank you! I tried exactly that, and it worked. Splendid!
Can I ask you for a wee bit more ...
for many of these Classical titles, I also appended the name of the artist, eg (Mullova). Can you add to your Regex expression some magic to remove this, if it is present, so
Beethoven Piano Concerto No 3 (Brendel)
becomes
Piano Concerto No 3
Thanks again.
-
It is late right now where I live, and I do not have any reference at hand. But you could try this:
Regex([Name],/#^.*? (.*) /(.*?/)$#/,1)
Try reverting the /( and /) if that does not work, i.e. \( and \).
MrC is really the Regex() guru here and he might work "the night shift", i.e. be in a different time zone.
-
Brilliant! The \( and \) worked. Don't know where you are - if you're ever in Scotland I'll buy you a pint. Whoever pays you should pay you more. Thank you :)
-
There's more here:
http://wiki.jriver.com/index.php/Media_Center_expression_language
-
Andy, whereabouts in Scotland are you? I'm in Edinburgh. Good to see a fellow Scot on the forums :)
-marko
-
Glad it worked for you.
I live in Stockholm, Sweden, so it was not _that_ late. I am just a user. I do not get paid for this. It is a hobby, like beer drinking.
And you should have a look at Marko's excellent reference page that Jim linked to. Much to learn there.
-
Marko - I'm in Glasgow, not so far ... I studied Computer Science at Edinburgh many decades ago - almost the first Computer Science course there ever was - Edinburgh Uni had it's own language called IMP and I typed my programs onto punched cards. In those days I'd have read your guide, stayed up all night, taught myself regular expressions, I dare say written my own parser and got it all to work .. now, one of the small advantages of being (a lot) older is that I have no shame in asking for help. Thanks again guys.
-
Andy, whereabouts in Scotland are you? I'm in Edinburgh. Good to see a fellow Scot on the forums :)
-marko
I believe weehappypixie is also a Scot.
-
... have a look at Marko's excellent reference page that Jim linked to. Much to learn there.
That's a combined work of both Marko and MrC. It's an amazing work.
-
That's a combined work of both Marko and MrC. It's an amazing work.
Of course. Sorry about that, MrC.
-
Simple MC user from the beginning, love it.
Thanks for the link JimH a lot to learn. We drink Rum And Coca Cola in the Dominican Republic.