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 »

MMuser2011 wrote:I have a speed issue:
If I search for all albums in my (huge) Entire Library with the wrong/double spelled "(disc x) (disc x)" in the album name - with x as a number from 1-999 - I do a search with this regexp into the field ALBUM

Code: Select all

(\(disc ([1-9][0-9]{0,2})\)) (\(disc ([1-9][0-9]{0,2})\))
and replace it with $1.
Technically, this works perfect.
Because I'm cautious, I would like to see all the matching results of the RegExp before I press "replace all". If I choose "Select matched", it takes over 12 Minutes until I get the result. The other option "Keep matched" is just a few seconds faster.

So how can I do a RegExp search in my entire library and only get back the matching result visible BEFORE I apply any changes?
Just to compare: If I use the builtin CTRL-F search and look for the fixed string "(disc 1) (disc 1)" it takes 5 seconds to obtain my desired result. What am I doing wrong? How can I speed this up?
Well, the built-in Search option is based on SQL while this script is based on VBScript. SQL is the fastest for the database manipulations, but VBScript is more flexible. For example, with the built-in option you cannot search for an unspecified string like disc x where x could be any number. By the way, if you want to search for some string that is at the end of some field, you could add the $ at the end of the regular expression. I am not sure, but I suppose that the execution would be faster in that case since programmatically it is always faster if you search for some string from the begin or the end rather then if it is in any another place in the middle.

If you want to get displayed only tracks that have Album containing "(disc x) (disc x)" maybe you could try Magic Nodes add-on with the next Filter:

Code: Select all

<Album> Glob '*(disc *) (disc *)*'
I didn't try it, but I suppose it should work. After that you could apply RegExp on the filtered tracks.
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
steviegt
Posts: 311
Joined: Tue Mar 17, 2009 8:39 am

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

Post by steviegt »

Can anyone please help with making a correction to a result? I know for some it's a bother to answer this type of question so any help is appreciated. I know zip about creating/correcting this sort of thing. Thanks in advance.

I want to add a new subfolder after "Music" to show the artist name and remove the artist from the track info & keep everything else the same.

The current "Replace With" is:

"C:\Users\Steve\Music\" & SDB.Tools.FileSystem.CorrectFilename(oSongData.ArtistName & " - " & oSongData.AlbumName & IIf(Len(oSongData.DiscNumberStr) > 0, " - Disc " & oSongData.DiscNumberStr, "") & " - " & Right("0" & oSongData.TrackOrderStr, 2) & " - " & oSongData.Title) & ".$4"

This is the result:

C:\Users\Steve\Music\Dream Theater - A Dramatic Turn Of Events - 01 - On The Backs Of Angels.flac

The desired result is:

C:\Users\Steve\Music\Dream Theater\A Dramatic Turn Of Events - 01 - On The Backs Of Angels.flac
MMW Gold Lifetime v4.1.21.11875
MM Pro Android v1.3.2.0824
Windows Home 10.0.17134.228 64-bit Build 1803
MS Edge


Next to MediaMonkey, the best program available: Total Commander http://www.ghisler.com/

"Being mean to someone takes more effort than being nice to them"
alfawykx
Posts: 1
Joined: Thu Sep 20, 2012 6:22 am

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

Post by alfawykx »

how about using mm built-in feature auto-organize files to get the desired folder/file-name structure and use the properties window to remove the artist from tags?
BKKKPewsey
Posts: 361
Joined: Sun Jun 05, 2011 10:45 am
Location: United Kingdom

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

Post by BKKKPewsey »

Use auto-organise files with

Code: Select all

C:\Users\Steve\Music\<Artist>\<Album> - <Track#:2> - <Title> 
No need to use RegExp to do this.
:)
Everyone has the right to be stupid Image but some abuse the privilege
steviegt
Posts: 311
Joined: Tue Mar 17, 2009 8:39 am

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

Post by steviegt »

Thanks for responding. I use Auto-Organize. I just use this script for other things and I have a routine when tagging or changing files. I'd still be gratefull if you or someone could help me out.
MMW Gold Lifetime v4.1.21.11875
MM Pro Android v1.3.2.0824
Windows Home 10.0.17134.228 64-bit Build 1803
MS Edge


Next to MediaMonkey, the best program available: Total Commander http://www.ghisler.com/

"Being mean to someone takes more effort than being nice to them"
Nanya
Posts: 21
Joined: Wed Oct 03, 2012 8:04 pm

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

Post by Nanya »

The preset for lowercasing extensions doesn't work with any extension containing a lowercase letter. E.g., .Ogg, .Mp3, .wMa etc.

I've replaced this with (.+)\.([\d\w]+) in the "Find what" field, and "$1." & LCase("$2") in the "Replace with" field. Seems to work ok.
ObsessiveTagger

Soundtracks

Post by ObsessiveTagger »

Could this add on automatically change the genre field from whatever the existing genre is to "Soundtrack" for songs from soundtracks? Also could it automatically change any form of punctuation to a specified punctuation. For example, if the album title in a tag read "The Lost Boys: Original Motion Picture Soundtrack" I'd like to be able to remove the colon and put "Original Motion Picture Soundtrack" in parentheses. This would work for brackets, dashes, etc. and would be able to change them to the user's desired punctuation. Finally I'd like to be able to analyze a tag and automatically delete certain words in any of its fields. If I had an mp3 whose album title read "Batman Forever [Music from and inspired by the motion picture]" I'd like to remove "and inspired by". My end result for all of this would be to produce a tag whose genre was "Soundtrack", whose album artist was "Various Artists", and whose album title was "Batman Forever (Music from the Motion Picture)" without having to lay a finger on my keyboard or Auto-Tag from the web. If anyone knows if RegExp Find & Replace 4.3 could accomplish any of the above, please reply! Thank you!
macmcd
Posts: 96
Joined: Wed Jul 09, 2008 7:22 am

ISO8601 Dates In Podcast Titles

Post by macmcd »

Sorry if I have missed this already in this thread but couldn't find it with a search. I am trying to added the date to the start of podcast titles to differentiate them. Preset 102 - Add <From Field> followed by " - " to the begin of <Into Field> (only if exists)... almost does the job but the dates are not in ISO8601 format i.e. the title becomes:

2012-11-1 - Podcast Title

whereas I need it to be

2012-11-01 - Podcast Title

in order that podcasts sort correctly.

My programming experience is very limited (Amos anybody?), could some kind person give me an expression that would do this:

If exists date, then add to title in ISO8601 format followed by " - "

This would save me considerable time otherwise blundering about not knowing what I am doing.

Many thanks,
Mac.
Kevinowpb
Posts: 129
Joined: Sat Dec 22, 2007 10:18 am
Location: West Palm Beach
Contact:

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

Post by Kevinowpb »

How can I remove any QUOTES from <into field> (ie Title)

I see the Remove and Replace option, and the remove altogether option..... however, in both, it doesn't recognize the """ (quote in the middle of quotes) to find a quote..?

I don't have many.. I guess I could do it manually... but now, I just want to know if its possible..

Thanks!
carkey151
Posts: 24
Joined: Fri Jan 22, 2010 9:14 am

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

Post by carkey151 »

In one of the "Custom Fields" I have the chart listing for week debut, week peaked, chart position and weeks charted, for each song like this:
1/13/69--2/17/69--*03--9
Is there a way I can move the Chart Position to the front so it would look like this:
*03--1/13/69--2/17/69--9
I'm still using MM3 if that makes any difference.
Any help would be greatly appreciated!
TEN

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

Post by TEN »

Dude - I can't tell you how cool this thing is! I'm trying to import a vast collection of jazz and classical CDs into my computer and have been killing myself with the messed up track info that comes from freedb for multiple disk releases. This makes it really easy to bring some order to the chaos! :D
Hdhntr23
Posts: 106
Joined: Tue Nov 27, 2012 10:21 am

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

Post by Hdhntr23 »

Hey all!!

First let me say Im all for searching a forum for an answer before posting a question.

So... apologies in advance but with a 57 page thread, its almost impossible to find a specific answer.

Im looking for 2 things for this add-on to do for me and Im wondering if you guys can help me get it to do so?

1) I want it to add a zero at the beginning of my track #'s and I cant seem to figure out how to get it to do it (1-9) etc.

2) I want all new words to be capitlized

I spose if I were greedy and putting a wish list, Id like to figure out how to switch [ * ] or { * } to ( * ) or ft. to Feat etc?

I appreciate any help in advance...

THANKS!
BKKKPewsey
Posts: 361
Joined: Sun Jun 05, 2011 10:45 am
Location: United Kingdom

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

Post by BKKKPewsey »

Hdhntr23 wrote:First let me say Im all for searching a forum for an answer before posting a question.
Searching your RegExp Find & Replace add-on may have been useful.
Hdhntr23 wrote:1) I want it to add a zero at the beginning of my track #'s and I cant seem to figure out how to get it to do it (1-9) etc
Preset 81"Add leading zero to single-digit Track number"
Hdhntr23 wrote:2) I want all new words to be capitlized
Preset 236 "Capitalize <Into Field> (ASCII, Latin-1, Latin-2 & Cyrillic)..."

Note my preset no's may be slightly different on your copy

Also MM standard script Case checker will capitalize (strangely enough :-? )

:)
Everyone has the right to be stupid Image but some abuse the privilege
Hdhntr23
Posts: 106
Joined: Tue Nov 27, 2012 10:21 am

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

Post by Hdhntr23 »

BKKKPewsey wrote:
Hdhntr23 wrote:First let me say Im all for searching a forum for an answer before posting a question.
Searching your RegExp Find & Replace add-on may have been useful.
Hdhntr23 wrote:1) I want it to add a zero at the beginning of my track #'s and I cant seem to figure out how to get it to do it (1-9) etc
Preset 81"Add leading zero to single-digit Track number"
Hdhntr23 wrote:2) I want all new words to be capitlized
Preset 236 "Capitalize <Into Field> (ASCII, Latin-1, Latin-2 & Cyrillic)..."

Note my preset no's may be slightly different on your copy

Also MM standard script Case checker will capitalize (strangely enough :-? )

:)
Great thanks!

Now if I could just figure out how to load either preset?

Im going to regret saying this but Ive been toying around with the add-on for an hour and I cant find how to load in the app?

Thanks in advance!
Hdhntr23
Posts: 106
Joined: Tue Nov 27, 2012 10:21 am

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

Post by Hdhntr23 »

Hdhntr23 wrote:
BKKKPewsey wrote:
Hdhntr23 wrote:First let me say Im all for searching a forum for an answer before posting a question.
Searching your RegExp Find & Replace add-on may have been useful.
Hdhntr23 wrote:1) I want it to add a zero at the beginning of my track #'s and I cant seem to figure out how to get it to do it (1-9) etc
Preset 81"Add leading zero to single-digit Track number"
Hdhntr23 wrote:2) I want all new words to be capitlized
Preset 236 "Capitalize <Into Field> (ASCII, Latin-1, Latin-2 & Cyrillic)..."

Note my preset no's may be slightly different on your copy

Also MM standard script Case checker will capitalize (strangely enough :-? )

:)


Great thanks!

Now if I could just figure out how to load either preset?

Im going to regret saying this but Ive been toying around with the add-on for an hour and I cant find how to load in the app?

Thanks in advance!

OK,

Turns out it didnt install properly and I was looking in the Tools section vs. the button in the tool bar.

I see all the presets, I just cant look at them by number... (How do I do that?)

Im getting there!

This looks like a kick ass script! Thanks a ton for writing it.
Post Reply