Destination Mask: Grab parts before/after string? [#19346][#19347]

Help improve MediaMonkey 5 by testing the latest pre-release builds, and reporting bugs and feature requests.

Moderator: Gurus

manalive
Posts: 45
Joined: Mon Nov 25, 2013 10:42 am

Destination Mask: Grab parts before/after string? [#19346][#19347]

Post by manalive »

Is there a way to grab X characters before the ":" in an album title, for example?

From the help page (https://www.mediamonkey.com/wiki/WebHel ... ormats/5.0) I see you can grab Right, Left, Mid and calculate Length. Usually formula systems have a way to find where a character or string is in a value so you can pull it out with the other functions.
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Destination Mask: Grab parts before/after string?

Post by Lowlander »

No, the options aren't as extensive as in programming. RegExp was a good way to achieve this, but it hasn't been updated for MediaMonkey 5.
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Destination Mask: Grab parts before/after string?

Post by Peke »

Hi,
I found this inspiring, so I added it as https://www.ventismedia.com/mantis/view.php?id=19346
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
manalive
Posts: 45
Joined: Mon Nov 25, 2013 10:42 am

Re: Destination Mask: Grab parts before/after string? [#19346]

Post by manalive »

Wow, thank you for adding this!

It looks like your method of doing it is to allow Left and Right to use a string instead of a number and just grab everything after that string. That will give me what I want for my use case.

But I would also suggest that you add a function that returns the position of the Nth instance of a character or string. This would allow users to grab anything from any value available when combined with the other functions.
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Destination Mask: Grab parts before/after string? [#19346]

Post by Peke »

Hi,
Good catch. I added $POS as https://www.ventismedia.com/mantis/view.php?id=19347 as Wishlist.

EDIT: I expanded it with $LAST mask to get position of last found String within a string
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
manalive
Posts: 45
Joined: Mon Nov 25, 2013 10:42 am

Re: Destination Mask: Grab parts before/after string? [#19346][#19347]

Post by manalive »

I've been using this in 2662 and it's great!

I think my last suggestion is turning out to be relevant-

$POS should accept a third parameter for nth instance of the string. Right now we can only get the first and last instance of the string.

I would also recommend a COUNT function to find out how many times it occurs.

Combining $IF, $Len, $Left/$Right/$Mid with $POS and $Count means you have a complete system and can grab any string without resorting to RegEx.
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Destination Mask: Grab parts before/after string? [#19346][#19347]

Post by Peke »

Hi,
$COUNT is not much important, you can still get that, but bit more complex.

Glad you liked it.

Happy Monkeying!
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply