RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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*)
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
dwofford
Posts: 2
Joined: Tue Dec 19, 2006 2:36 pm

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

Post by dwofford »

Perfect! The update for both of the name swap presets works great. Thanks.
userasis
Posts: 2
Joined: Sun Oct 30, 2011 10:31 pm

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

Post 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"?
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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".
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
userasis
Posts: 2
Joined: Sun Oct 30, 2011 10:31 pm

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

Post 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.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Metazargo
Posts: 42
Joined: Mon Jan 25, 2010 8:24 am

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

Post 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.
Music is the Answer

Manage it with MediaMonkey
LIsten to it on Squeezebox Touch, -Radio, -Controller, -Receiver, Squeezelite-X, iPeng on iPhone
Serve it by Squeezebox Server aka LMS running on QNAP
Store it to NAS Raid 1 with backup to OneDrive
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
elliottdp
Posts: 27
Joined: Tue Mar 22, 2011 1:27 pm

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

Post 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
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
elliottdp
Posts: 27
Joined: Tue Mar 22, 2011 1:27 pm

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

Post by elliottdp »

As always, ZvezdanD, Thank you very much.
TEdgeNYC
Posts: 4
Joined: Sat May 27, 2006 5:59 am
Location: New York City

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

Post 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.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post 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
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
TEdgeNYC
Posts: 4
Joined: Sat May 27, 2006 5:59 am
Location: New York City

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

Post 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!
Post Reply