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

FEB
Posts: 83
Joined: Sat Mar 01, 2008 6:57 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by FEB »

ZvezdanD wrote:
FEB wrote:I'd like to move all entries in the 'Publisher' section to 'Custom 2'
Just take a look at the "Copy the Date when the file is created to the Date added field" preset and choose wanted fields from Into and From dropdown lists. After copying, if you want to delete Publisher field, you could use the "Clear the Comment field" preset with changed field in the Into dropdown list.
Well, that's just brilliant, Z, thanks a lot! To complete it, I need to change 'Custom 2' to read 'Publisher' in the now playing pane. I'm sure it's easy to do, I just don't know how.

edit: found it - my collection is complete!

Super stuff, thanks again!
FEB
Posts: 83
Joined: Sat Mar 01, 2008 6:57 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by FEB »

One thing to note, and perhaps you might want to put some sort of change in, but when I edited 'Custom 2' to read 'Label', neither RegExp or Magic Nodes would start. Presumably the vbs script expicitly calls 'Custom 2'.

Hope this helps...
DeathAxe

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by DeathAxe »

Suggestion for performance boost

Scenario:
1. I select a list of 5000 songs, which I want to replace the ´ by ' (Actually maybe 100 songs have the ´ and the rest is clean.)
2. I start RegExpReplace with those 5000 songs.
3. I press "replace all" button and RegExpReplace starts to alter EACH song's id3tag which may take a long long time to go, even though only 100 files would need update!

My suggestion is to check first if an item/song is to be changed and only update those ones. Leaving all noninteresting files (not containing the ´) as is, would increase the speed of replacement very much.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

FEB wrote:when I edited 'Custom 2' to read 'Label', neither RegExp or Magic Nodes would start.
I am not sure that understand. I just renamed "Custom 2" field in the Options dialog to "Label", restarted MM and both Magic Nodes and RegExp works fine and RegExp even display "Label" instead of "Custom 2" in the Into and From dropdown lists. Could you tell me what exactly is happening to you?
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 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

DeathAxe wrote:My suggestion is to check first if an item/song is to be changed and only update those ones.
Thanks for suggestion, but this script already works like that. If you take a look on the source code you would see such check in its main function ReplaceSongData in the line 3009:

Code: Select all

        If CStr(sAfter) <> CStr(sBefore) Then
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
mysticalgrooves
Posts: 2
Joined: Wed Nov 19, 2008 4:23 am

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by mysticalgrooves »

How do i go about in configuring this function?

I want to swap the values in the disc number field with the track number field.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

mysticalgrooves wrote:I want to swap the values in the disc number field with the track number field.
This script could be used only for modifications of one field at time, but swapping should be applied on two fields in same time. Actually, you could swap two fields using three presets, but it is better to use Steegy's script for such thing.
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
DeathAxe

Issues with none released objects causing memory leaks.

Post by DeathAxe »

Hi, I am not an expert in VisualBasic, but I think you have to release/delete objects created with the new operator just like it has to be done in C++?!

In function RegExp(sExpr, sPattern, lItem) you create an object for RegExp by Set RE2 = New RegExp. This means you must add a line called RE2 = Nothing at the end of this function. Otherwise the object is not deleted what is simply causing a memory leak. The same issue can be found in several other functions of your code!

Please fix your memory leaks!
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Issues with none released objects causing memory leaks.

Post by ZvezdanD »

DeathAxe wrote:I am not an expert in VisualBasic,

Please fix your memory leaks!
Please check your suggestions before you attack me ;) VBscript (as well as Visual Basic) don't need to manually release objects at the procedure end - they are automatically removed from memory.
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
declan
Posts: 85
Joined: Wed Sep 20, 2006 3:55 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by declan »

I've downloaded the installer. I open MM as an adminsitrator (I'm using Vista) then I click on the installer and the installer opens a second mm, which isn't being run as administrator so the installation fails. How do I get around this?
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

declan wrote:I've downloaded the installer. I open MM as an adminsitrator (I'm using Vista) then I click on the installer and the installer opens a second mm, which isn't being run as administrator so the installation fails. How do I get around this?
Well, you could temporarily turn on the option Tools / Options / General / Allow just one instance of MediaMonkey.
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
declan
Posts: 85
Joined: Wed Sep 20, 2006 3:55 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by declan »

Well I got it to install by following the MM2 method turning it into a zip file and dragging into the Auto file.

But the problem that got me to re-install in the first place persists. Basically, the masks have gone mental and now look like this -

"Remove trailing/leading spaces from the Title", " Another Brick in the Wall -> Another Brick in the Wall", ", "^(\s*)(.*?)(\s*)$", "Title", "True", "False", "$2", "Title", "False", "False", "False"

Is this going to be connected to installing the latest Beta version on MM?
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

declan wrote:Is this going to be connected to installing the latest Beta version on MM?
This script works fine with MM 3.1. Presets are stored in the MediaMonkey.ini file as your example indeed and they have nothing in common with Magic Nodes masks (I think this is what you expected). If you look at RegExpReplace.ini in Auto folder you would see same form of presets.

Have you tried my suggestion with the option "Allow just one instance "?
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
declan
Posts: 85
Joined: Wed Sep 20, 2006 3:55 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by declan »

That's not what I'm saying.

What happened is -

1. I used this script prior to upgrading to 3.1
2. I used it after the upgrading
3. But the masks became corrupted, so they now look like this...

Image

The reinstall issue arose because I tried to fix it by reinstalling but the error predated it.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

declan wrote:the masks became corrupted
Sorry, you confused me because you mentioned masks. In the RegExp I am calling them presets, but Magic Nodes masks are somehow indeed corrupted with your RegExp presets, as you could see them in the Preset dropdown list. I don't think this is related with the installation of the new version of MM, but have no idea what is a reason. Only thing I could suggest is to uninstall both scripts, when the scipt asks if you want to remove its settings you should choose Yes and try to install them again. If this cannot help, you could always manually edit MediaMonkey.ini file - just remove RegExpPresets and/or CustomNodeMasks sections from it. If you have XP, this .ini file is in c:\Documents and Settings\your_username\Local Settings\Application Data\MediaMonkey\. Of course, after that you would loose all your MN masks and RegExp presets, but I suppose you already have backup of them.
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
Post Reply