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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Postby ZvezdanD » Tue Nov 15, 2011 12:37 pm

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby ZvezdanD » Tue Nov 15, 2011 12:46 pm

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby dwofford » Wed Nov 16, 2011 10:15 am

Perfect! The update for both of the name swap presets works great. Thanks.
dwofford
 
Posts: 2
Joined: Tue Dec 19, 2006 2:36 pm

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

Postby userasis » Wed Nov 16, 2011 10:31 am

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"?
userasis
 
Posts: 2
Joined: Sun Oct 30, 2011 10:31 pm

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

Postby ZvezdanD » Wed Nov 16, 2011 11:33 am

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby userasis » Wed Nov 16, 2011 11:51 am

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.
userasis
 
Posts: 2
Joined: Sun Oct 30, 2011 10:31 pm

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

Postby ZvezdanD » Wed Nov 16, 2011 4:15 pm

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby Metazargo » Sat Dec 03, 2011 9:44 am

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 Management: Media Monkey 4.0.2.1462
Music Playing: Squeezebox Server (QPKG); Squeezebox Touch, -Radio, -Controller, -Receiver; SoftSqueeze; iPeng on iPhone
Music Store: QNAP TS-259 Pro with Western Digital Caviar Black 2TB WD2001FASS in Raid 1 Ext3
Metazargo
 
Posts: 41
Joined: Mon Jan 25, 2010 8:24 am

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

Postby ZvezdanD » Sat Dec 03, 2011 10:50 am

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby elliottdp » Mon Dec 05, 2011 1:22 pm

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
elliottdp
 
Posts: 27
Joined: Tue Mar 22, 2011 1:27 pm

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

Postby ZvezdanD » Mon Dec 05, 2011 2:31 pm

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby elliottdp » Mon Dec 05, 2011 3:23 pm

As always, ZvezdanD, Thank you very much.
elliottdp
 
Posts: 27
Joined: Tue Mar 22, 2011 1:27 pm

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

Postby TEdgeNYC » Mon Dec 12, 2011 4:49 pm

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.
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

Postby ZvezdanD » Tue Dec 13, 2011 4:22 pm

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.2 (2011-07-01) RegExp Find & Replace 4.3 (2011-07-06)  Invert Selection/Select None 1.5 (2012-02-04)  Export/Create Playlists for Child Nodes 4.0.4 (2013-08-03)  Expand Child Nodes/Expand All 1.1.1 (2012-02-13)  Event Logger 2.4.1 (2012-02-06)  Filtered Statistics Report 1.5.1 (2009-10-09)  Track Redirection & Synchronization 3.4 (2012-10-08)  Restore/Synchronize Database 3.1.2 (2013-08-31)  Find Currently Playing Track 1.3 (2013-11-09)  Queue List 1.2 (2012-02-06)  Add to Library on Play 1.0 (2010-10-20)  Tree Report for Child Nodes 1.1 (2010-11-04)  Update Location of Files in Database 1.3.3 (2012-06-12)  Inherit Child Playlists 1.0.1 (2013-07-10)  Add Currently Playing/Selected Track(s) to Playlist 1.1.1 (2012-02-06)
ZvezdanD
 
Posts: 2747
Joined: Thu Jun 08, 2006 7:40 pm

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

Postby TEdgeNYC » Tue Dec 13, 2011 8:04 pm

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!
TEdgeNYC
 
Posts: 4
Joined: Sat May 27, 2006 5:59 am
Location: New York City

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests

cron