Page 51 of 100

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Nov 15, 2011 12:37 pm
by ZvezdanD
absence_media wrote:Hi, I'm stuck on copying the remix artist into the albumartist field.
There is a preset where you can assign it to a field, but it copies the word remix as well and in case there is no remix it empties the albumartist field.
Preset: Assign (name remix/version/edit) from the end of <From Field> to <Into Field> (version name only) (only if exists)...
Description: Rain Down Low (Freemasons Remix) or Rain Down Low [Freemasons Remix] (source field) -> Freemasons (destination field)
Find what: ^.*
Into: whatever, e.g. Album Artist
Regular expression 1: checked
Replace with: IIf(Len(SetVar(0, RegExpEx(<From Field>, "[([]([^)\]]*)\s((?:re)?mix|edit|extended|dub|instrumental|live|demo|version)((?=\W)[^([]*[)\]]$)", 0, 0))) > 0, GetVar(0), "$&")
From: whatever, e.g. Title
VBScript expression: checked

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Nov 15, 2011 12:46 pm
by ZvezdanD
dwofford wrote:I am having an issue with the Swap first and last name of <Into Field> with added ", "... preset when handling a list of names. The problem occurs when one of the names is a single name.
Thanks for the report. Here is the fixed Find what string: ([^;\s*]+?)(\s+)([^\s]+?)($|\s&\s|;\s*)

By the way, if you use the "Swap last and first name of <Into Field> with removed ", "..." preset, here is its fixed string: ([^;\s*]+?),(\s+)(.+?)($|\s&\s|;\s*)

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Wed Nov 16, 2011 10:15 am
by dwofford
Perfect! The update for both of the name swap presets works great. Thanks.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Wed Nov 16, 2011 10:31 am
by userasis
Thanks for the script, very robust.
I'd like to change the currently playing song instead of the selected one(s).
I use presets with shortcuts, like for instance set genre to "3" on "shift+a", so it would help.
Can it be done?
And by the way, how do I use the numpad keys on the shortcut field, for instance how I'd write "shift+num 1"?

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Wed Nov 16, 2011 11:33 am
by ZvezdanD
userasis wrote:I'd like to change the currently playing song instead of the selected one(s).
Can it be done?
Here is the excerpt from the first post of this thread:
To-Do List:
* possibility to apply some preset to the currently playing track (currently it could be applied only to selected/visible tracks).

So, the answer is: no, it cannot be done... currently.
And by the way, how do I use the numpad keys on the shortcut field, for instance how I'd write "shift+num 1"?
I haven't tried, but I suppose that it should be exactly as you wrote, i.e. "shift+num 1".

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Wed Nov 16, 2011 11:51 am
by userasis
Thanks for the quick answer, very good to-do list by the way, any of the items in it would help a lot.
shift+num 1 doesn't work for me, but it's okay, I'll use the letters.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Wed Nov 16, 2011 4:15 pm
by ZvezdanD
userasis wrote:shift+num 1 doesn't work for me, but it's okay, I'll use the letters.
Well, that is the program's bug. Just tried, only Num +, Num - and Num * work as shortcuts, other numerical keys don't. If you want, you could report that in the Bug forum.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Dec 03, 2011 9:44 am
by Metazargo
I love this amazing tool.

This means I can only upgrade to MM 4.x if this plug-in is working with that release.

It's documented MM 2.x and above in June.

Please precise, thanks.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Sat Dec 03, 2011 10:50 am
by ZvezdanD
Metazargo wrote:I love this amazing tool.

This means I can only upgrade to MM 4.x if this plug-in is working with that release.

It's documented MM 2.x and above in June.

Please precise, thanks.
Glad you like it. If you read the Installation section of the first post you would see the next text: "For MediaMonkey 3.0 or higher ...". Also, if you read the What is new section you would see in many places the added options related to MM4, e.g. there are added Series, Director, Producer, Actor, Parental Rating, Episode #, Season # and Type fields which are introduced in MM4.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Mon Dec 05, 2011 1:22 pm
by elliottdp
Quick question.


Is there away to assign Artist from sub-folder name ie. H:\Audio SOURCE Files\Metallica\One.mp3
I would like to copy just the name Metallica into the Artist field.

Sometimes it would be multiple artists separated by a semi colon ---> h:\Audio SOURCE Files\Beach Boys; Fat Boys\Wipeout.mp3

I know I can do it in a couple of presets, but just wondering if it can be done in one step.
Thanks

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Mon Dec 05, 2011 2:31 pm
by ZvezdanD
elliottdp wrote:Is there away to assign Artist from sub-folder name ie. H:\Audio SOURCE Files\Metallica\One.mp3
If you want to assign the last folder of the Path to the Artist, you could use this settings:
Find what: ^.*
Into: Artist
Regular expression 1: checked
Replace with: [^\\]+(?=\\[^\\]+\.[^\.\\]+$)
From: Path
Regular expression 2: checked

However, for such simple extractions of the Path I think it could be simper to use the Auto-Tag option of the program.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Mon Dec 05, 2011 3:23 pm
by elliottdp
As always, ZvezdanD, Thank you very much.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Mon Dec 12, 2011 4:49 pm
by TEdgeNYC
I have over a thousand of the following because that is the way they were tagged by MusicBrainz over the years:

Title: <title> (feat. <artist>)
Artist: <main artist>

What I would like is:

Title: <title>
Artist: <main artist>; <artist>

I like how MM4 handles multi-values and a number of the scripts I use (GenreFinder, BatchArtFinder, etc.) don't play well with "(feat..." meaning the field that is passed to the lookup (Last.FM, Google, etc.) is not found but for a multi-field, the first value is used in the lookup and will be found.

I would appreciate assistance with providing an appropriate expression.

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Dec 13, 2011 4:22 pm
by ZvezdanD
TEdgeNYC wrote:Title: <title> (feat. <artist>)
Artist: <main artist>

What I would like is:

Title: <title>
Artist: <main artist>; <artist>
You have at least three possibilities to do that. The first one is with three existing presets:
1. Copy featuring artists or [(featuring artist)] from the end of Title to the end of Artist,
2. Replace "&", feat./pres./vs. with "; " in <Into Field>... (specify Artist in the Into list and remove "&|" from the Find what string),
3. Remove featuring artists or [(featuring artists]) from the end of <Into Field>... (specify Title).

Instead of using the first two mentioned presets, you could create the new preset with the following settings:
Preset: Add featuring artists or [(featuring artist)] from the end of Title to multi-item Artist
Description: Title feat. Artist1, Artist2 or Title [feat. Artist1, Artist2] or Title (feat. Artist1, Artist2) -> Artist; Artist1, Artist2
Find what: $
Into: Artist
Regular expression 1: checked
Replace with: RegSub(RegExpEx(oSongData.Title, "\b(?:ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents)\s([^\]\)]+)", 0, 0), "^.+$", "; $$&")
VBScript expression: checked

The third possibility could be executed in just one step with single preset, but it requires RegExp version 4.2 or newer:
Preset: Move featuring artists or [(featuring artist)] from the end of Title to multi-item Artist
Description: Title feat. Artist1 or Title [feat. Artist1] or Title (feat. Artist1) -> Artist; Artist1 (Artist field), Title (Title field)
Find what: \s*([\(|\[].*)?\b(?:ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents)\s.+[\)|\]]?$
Into: Title
Regular expression 1: checked
Replace with: Eval(IIf(bReplacing, "Execute(""oSongData.ArtistName = oSongData.ArtistName & RegSub(RegExpEx(oSongData.Title, """"\b(?:ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents)\s([^\]\)]+)"""", 0, 0), """"^.+$"""", """"; $$&"""")"")", """"""))
VBScript expression: checked

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Posted: Tue Dec 13, 2011 8:04 pm
by TEdgeNYC
The third possibility could be executed in just one step with single preset, but it requires RegExp version 4.2 or newer:
Preset: Move featuring artists or [(featuring artist)] from the end of Title to multi-item Artist
Description: Title feat. Artist1 or Title [feat. Artist1] or Title (feat. Artist1) -> Artist; Artist1 (Artist field), Title (Title field)
Find what: \s*([\(|\[].*)?\b(?:ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents)\s.+[\)|\]]?$
Into: Title
Regular expression 1: checked
Replace with: Eval(IIf(bReplacing, "Execute(""oSongData.ArtistName = oSongData.ArtistName & RegSub(RegExpEx(oSongData.Title, """"\b(?:ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents)\s([^\]\)]+)"""", 0, 0), """"^.+$"""", """"; $$&"""")"")", """"""))
VBScript expression: checked
This was exactly what I wanted. Works great. Thank you!