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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

SDJeff
Posts: 88
Joined: Sat Mar 01, 2008 9:36 pm
Contact:

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

Post by SDJeff »

Cool script!

For renaming files in general I use bulk rename utility
http://www.bulkrenameutility.co.uk/Main_Intro.php

I have a lot of photos that I have the need to add dates to the file name and other documents for work that would take hours to do one by one. I have used most of this script's reg exp presets in one way or another with BRU.

Since I've started using MM I just tag the MP3 an use auto-organize to rename the file.
Owyn
Posts: 2018
Joined: Fri Mar 21, 2008 10:55 am
Location: Canada
Contact:

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

Post by Owyn »

This has been my most frequently used script for the last while.

I have been busy adding sub-genre to Genre for my blues collection. Having the button pre-loaded with:

Find what: $
Into: Genre
RegExp: Checked

Makes it trivial to append a sub-genre to the current selection set.

Many thanks.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies
GuyScharf
Posts: 85
Joined: Fri Oct 24, 2008 2:34 am
Contact:

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

Post by GuyScharf »

How do I create a new preset?

When I start MM and open the RegExp dialog, the default preset is "0" and I can enter my new parameters there and save this as a new preset, which appears at the end of the list of presets.

So, that works for creating one new preset. How do I create a second new preset? I don't see how to create an "empty" preset that I can modify and save.

Thanks.
ZvezdanD
Posts: 3112
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

GuyScharf wrote:How do I create a new preset?
The Save button has three different functions, depending of applied modifications:
1. if you change only the Preset name of some existing preset - Save = Rename;
2. if you change some option of the existing preset, but not its name - Save = Update;
3. if you change some option of the existing preset AND its name as well - Save = Add new.
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
GuyScharf
Posts: 85
Joined: Fri Oct 24, 2008 2:34 am
Contact:

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

Post by GuyScharf »

I've been creating presets nicely but have now hit a snag.

I have a title of the form "yymmdd text" and I am trying to extract the "yymmdd" and put it in the date. My VBScript expression to do this is: mid(oSongData.Title,3,2) & "/" & mid(oSongData.Title,5,2) &"/20"&left(oSongData.Title,2) and the expression seems good, producing a result like "09/25/2008". However, when I run it, I get a VBScript runtime error "type mismatch" for "oSongData.year".

Do I need to do some kind of type conversion or is setting mm/dd in the date not supported? (I can set the date to 09/25/2008 by typing that value into the date field in MM.)

Thanks!
ZvezdanD
Posts: 3112
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

GuyScharf wrote:or is setting mm/dd in the date not supported?
This is it. MM developers decided to introduce two new SongData properties with MM3, Month and Day, instead to extend existing property Year. I think they should have introduced YearString at least, as they did with TrackOrder and TrackOrderStr or DiscNumber and DiscNumberStr.

Maybe I would add some workaround for this in the next version of the script. In meantime, if you don't want to wait for it, you could modify the script by yourself adding the next lines to the SongDataDict collection on the begin of the script:

Code: Select all

    If CurrentVersion() >= 300 Then
        .Add "Month", "Month"
        .Add "Day", "Day"
        .Add "Original Month", "OriginalMonth"
        .Add "Original Day", "OriginalDay"
    End If
Also, you should add next lines to the isNumericDict collection:

Code: Select all

    If CurrentVersion() >= 300 Then
        .Add "Month", True
        .Add "Day", True
        .Add "Original Month", True
        .Add "Original Day", True
    End If
After that you could assign your dates with three presets, first you should assign a Year (i.e. Date), than a Month and in the end a Day. Not so practical, but it could do a work. Sorry for inconvenience.
Last edited by ZvezdanD on Wed Nov 26, 2008 2:01 pm, edited 1 time in total.
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
GuyScharf
Posts: 85
Joined: Fri Oct 24, 2008 2:34 am
Contact:

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

Post by GuyScharf »

Thank you. I updated regexp and the new Month and Day fields appear. But it does not appear to be working correctly.

I set the date to 2008 and that works fine.
I then set the month to 09 and the date becomes "9000" (as shown in MM display)
Similarly, when I set the day to 25, the date becomes "2500" (as shown by MM; it is "25" as shown by Windows Explorer)

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

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

Post by ZvezdanD »

I just tried and it works correctly. Could you send Find what and Replace with strings or even better the screenshots with your settings for each step?
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: 3112
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

By the way, I have slightly updated previous code because I wrote incorrectly Original Month and Original Day. It is not related to your attempt, but just in case if someone else is interested for this.
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
GuyScharf
Posts: 85
Joined: Fri Oct 24, 2008 2:34 am
Contact:

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

Post by GuyScharf »

It's certainly likely that I have done something wrong!

Whoops! Never mind! I found it; I wasn't putting the month and day into the correct field!

Thank you so much for the changes to RegExp. They will help me greatly.

Guy
justin_f
Posts: 92
Joined: Thu Nov 22, 2007 11:41 am
Location: Valpo, IN
Contact:

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

Post by justin_f »

I'm trying to remove a specific string from a number of songs, and I don't know enough about Regular Expressions to figure it out, even after poking around a bit.

I download alot of songs from RCRDLBL.com, but the songs always have "Get free music at rcrdlbl.com" appended to the album title. What would I use to remove this without having to manually change each album?

Thanks in advance.

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

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

Post by ZvezdanD »

justin_f wrote:What would I use to remove this without having to manually change each album?
This could be very simple, you even don't need to use Regular expressions for that. Just type string which you want to remove into the Find what field, choose Album from the Into dropdown list and leave the Replace with field blank. However, if you want to remove some string only from the end of some field, you could turn on the Regular expression 1 and append "$" to the end of this string, e.g. " Get free music at rcrdlbl\.com$" (note the backslash in the front of the period in this case - this is because the perod has special meaning with regular expressions and the backslash is using to treat the next character as standard character).
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
justin_f
Posts: 92
Joined: Thu Nov 22, 2007 11:41 am
Location: Valpo, IN
Contact:

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

Post by justin_f »

That was perfect. Did exactly what I needed. Thanks a ton.

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

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

Post by FEB »

I'd like to move all entries in the 'Publisher' section to 'Custom 2', so that I can sort by Publisher in the main pane. Can RegExp do this? If not, what can?

Thanks!
ZvezdanD
Posts: 3112
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: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.
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