Author Topic: How to use $First and $RSplit with multiple separators?  (Read 2379 times)

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
Hi!

I'm trying to extract the surname from the <Composer> to create folders. Right now, this is my formula:

• <Genre> •\· · $First($RSplit(<Composer>," ",1)) · ·\

, but I ran into problems if there are sometimes two composers separated by a semi-colon.
If the <Composer> for example is

Tomaso Albinoni; Remo Giazotto

how would I use Musicbee's functions to only extract Albinoni (and also if there were even more names, or some composer with more names than two, like all Russian)? As far as I understand, I can't use $Or inside anything but $If?


Edit: Sorry, posted in wrong forum.
Last Edit: November 18, 2021, 08:29:15 PM by Johan_A_M

hiccup

  • Sr. Member
  • ****
  • Posts: 7793
Does this do what you are looking for?:

$If($Contains(<Composer>,;)="T",$RSplit($Split(<Composer>,;,1)," ",1),$RSplit(<Composer>," ",1))

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
Does this do what you are looking for?:

$If($Contains(<Composer>,;)="T",$RSplit($Split(<Composer>,;,1)," ",1),$RSplit(<Composer>," ",1))
Oh yes it does! Thanks hiccup, you saved my day!