RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Can't install RegExp F&R w/o scripts. MM3.1 problem?

Postby RabanePaco on Thu Jun 18, 2009 9:47 am

When I try to install RegExp F&R without the 101 sample presets I get the error message

Error #-2147419113 - SongsDB.SDBStringlist
List index out of bounds (0)
File ....\MM\scripts\Auto\RegExpReplace.vbs

There is not the RegExp menu item under Edit.

Installing with the presets seems to be o.k. (so I'll try them anyway :) )

I just updated to MM 3.1. I'm also using MagigNodes. I didn't use RegExp before (didn't know about it).

It seems a very intersting script. I have been using Mp3Tag extensively.
-- RabanePaco

System: Win XP Pro SP3.
MM 3.1 with Brushed Monkey, MagicNodes, RegExp Find & Replace
SqueezeBox Duet, iPod (classic)
RabanePaco
 
Posts: 75
Joined: Fri Jul 27, 2007 12:58 pm
Location: Amsterdam, The Netherlands

Re: Can't install RegExp F&R w/o scripts. MM3.1 problem?

Postby ZvezdanD on Thu Jun 18, 2009 12:37 pm

RabanePaco wrote:When I try to install RegExp F&R without the 101 sample presets I get the error message

Thanks for the report. There is a new release: v3.5.1 - 2009-06-18
- Fixed: error during start-up if none preset exists.
ZvezdanD
 
Posts: 1875
Joined: Fri Jun 09, 2006 12:40 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby stutes on Sat Jun 27, 2009 3:11 am

Just wondering if it is possible to append one field with another field. I would like to take the information in fields such as "Mood" and "Tempo" and append the data in the field to the Grouping field, ideally putting a comma and then a space before the data is added to the Grouping field.
Version: MediaMonkey 3.1.0.1236
Syncs iPod Touch 2nd Gen (firmware 2.2) and SD cards via card reader
(Touch also syncs with iTunes on a Mac, OS X 10.5, set manage podcasts, apps, photos, contacts & calendar, but NOT music)
stutes
 
Posts: 101
Joined: Tue May 13, 2003 2:06 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby ZvezdanD on Sat Jun 27, 2009 10:01 pm

stutes wrote:Just wondering if it is possible to append one field with another field. I would like to take the information in fields such as "Mood" and "Tempo" and append the data in the field to the Grouping field, ideally putting a comma and then a space before the data is added to the Grouping field.

Of course this is possible, you already have several predefined presets which combines two or more fields into one field, e.g. "Add the Track number to the begin of the Title". Here are settings for your example:
Find what:
Code: Select all
^.*

Into: Grouping
Regular expression 1: checked
Replace with:
Code: Select all
"$&" & IIf(Len(oSongData.Mood) > 0 And Len("$&") > 0, ", ", "") & oSongData.Mood & IIf(Len(oSongData.Tempo) > 0 And Len("$&" & oSongData.Mood) > 0, ", ", "") & oSongData.Tempo

VBScript expression: checked

The Replace with expression could be much simpler if you remove checking for empty fields, i.e. if you have all fields entered.
ZvezdanD
 
Posts: 1875
Joined: Fri Jun 09, 2006 12:40 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby stutes on Sun Jun 28, 2009 4:08 am

ZvezdanD, thank you for the reply. I figured RegExp could do this, but I couldn't figure out how to make it work with the fields I wanted to work with. I've no knowledge of VBscript.

I don''t think I need it to check for empty fields, and I didn't realize I could get it to append BOTH the Mood AND Tempo fields AT ONCE into the Grouping field—that's pretty cool! I was assuming I'd have to run it once to append the Mood to Grouping and then again to append the Tempo to Grouping.

I was also hoping to do the same thing with Custom 2 and Custom 3 (again, no need to check for empty fields as far I as I can tell... unless empty fields cause problems), and append the data in those fields to the Grouping field.

Would I be correct in assuming that the code for Custom 2 and 3 would look something like this?:
Code: Select all
    "$&" & IIf(Len(oSongData.Custom2) > 0 And Len("$&") > 0, ", ", "") & oSongData.Custom2 & IIf(Len(oSongData.Custom3) > 0 And Len("$&" & oSongData.Custom2) > 0, ", ", "") & oSongData.Custom3
Version: MediaMonkey 3.1.0.1236
Syncs iPod Touch 2nd Gen (firmware 2.2) and SD cards via card reader
(Touch also syncs with iTunes on a Mac, OS X 10.5, set manage podcasts, apps, photos, contacts & calendar, but NOT music)
stutes
 
Posts: 101
Joined: Tue May 13, 2003 2:06 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby ZvezdanD on Sun Jun 28, 2009 7:05 am

stutes wrote:Would I be correct in assuming that the code for Custom 2 and 3 would look something like this?:
Code: Select all
    "$&" & IIf(Len(oSongData.Custom2) > 0 And Len("$&") > 0, ", ", "") & oSongData.Custom2 & IIf(Len(oSongData.Custom3) > 0 And Len("$&" & oSongData.Custom2) > 0, ", ", "") & oSongData.Custom3

Yes, your Replace with string is correct. However, if you don't want to check for empty fields, you could write previous two presets as one, i.e. you could append Mood, Tempo, Custom 2 and Custom 3 in one go:
Code: Select all
"$&, " & oSongData.Mood & ", " & oSongData.Tempo & ", " & oSongData.Custom2 & ", " & oSongData.Custom3


But, if you have some field empty, e.g. Tempo, with such string you would get something like Grouping, Mood, , Custom2, Custom3. Or, if you have empty Grouping, you would get , Mood, Tempo, Custom1, Custom3 (note a comma on the begin). I don't know your intention, maybe this is even preferable for you.
ZvezdanD
 
Posts: 1875
Joined: Fri Jun 09, 2006 12:40 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby stutes on Mon Jun 29, 2009 3:12 pm

All at once: very cool! Thanks so much for your help; for someone like me who is vbscript illiterate, this is VERY helpful!
Version: MediaMonkey 3.1.0.1236
Syncs iPod Touch 2nd Gen (firmware 2.2) and SD cards via card reader
(Touch also syncs with iTunes on a Mac, OS X 10.5, set manage podcasts, apps, photos, contacts & calendar, but NOT music)
stutes
 
Posts: 101
Joined: Tue May 13, 2003 2:06 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby mk1065 on Mon Jun 29, 2009 7:40 pm

Anyone know how I could put all my featured artists in paranthesis. For example:

Find what - ft. Easy E
Replace with - (ft. Easy E)
mk1065
 
Posts: 6
Joined: Thu Feb 14, 2008 2:27 pm

RegSub Help

Postby GIL on Mon Jun 29, 2009 7:52 pm

Code: Select all
RegSub(RegSub(RegSub(RegSub(RegSub(oSongData.Path,"\bI\b","1"),"\bII\b","2"),"\bIII\b","3"),"\bIV\b","4"),"\bV\b","5")


Is there a more efficient way to do this?
I may be using more substitutions
GIL
 
Posts: 107
Joined: Sun Sep 07, 2008 3:46 pm

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby ZvezdanD on Mon Jun 29, 2009 8:53 pm

mk1065 wrote:Anyone know how I could put all my featured artists in paranthesis. For example:

Find what - ft. Easy E
Replace with - (ft. Easy E)

Find what:
Code: Select all
\b(?:ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents)\s.*[^)]$

Into: Artist
Regular expression 1: checked
Replace with:
Code: Select all
($&)
ZvezdanD
 
Posts: 1875
Joined: Fri Jun 09, 2006 12:40 am

Re: RegSub Help

Postby ZvezdanD on Mon Jun 29, 2009 9:48 pm

GIL wrote:
Code: Select all
RegSub(RegSub(RegSub(RegSub(RegSub(oSongData.Path,"\bI\b","1"),"\bII\b","2"),"\bIII\b","3"),"\bIV\b","4"),"\bV\b","5")


Is there a more efficient way to do this?
I may be using more substitutions

Well, you could not simplify it too much. You could try with the MapArray function as it is in the "Fix common words (I'm, I'll, don't, won't, ain't, isn't, can't)" preset. For your example:
Find what:
Code: Select all
\b(?:(I)|(II)|(III)|(IV)|(V))\b

Replace with:
Code: Select all
MapArray(Array("$1", "1", "$2", "2", "$3", "3", "$4", "4", "$5", "5"))

However, there is a bug in the MapChr function, so you need to modify the source code of the script if you want to write numbers as a replacement. In the line 987 instead of:
Code: Select all
If IsNumeric(sDst) Then

you should write:
Code: Select all
If VarType(sDst) = vbInteger Then

The next version of the script would have somewhat simpler MapArrayEx function with which you could write the Replace with string directly, without specifying strings for replacement in the Find what field as it is in previous case. Here is its future use:
Code: Select all
MapArrayEx("$&", Array("\bI\b", "1", "\bII\b", "2", "\bIII\b", "3", "\bIV\b", "4", "\bV\b", "5"))

If you are interested for such syntax, I could publish the updated script with that function. By the way, you will have a problem with English word "I" with those replacements.
ZvezdanD
 
Posts: 1875
Joined: Fri Jun 09, 2006 12:40 am

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby Big Isch on Tue Jun 30, 2009 7:27 am

Suggestion for Grouping of Presets

This is really a great tool with lots of capability and lost of presets. Such, some sort of grouping for
presets comes to mind, as already discussed in this topic.

My suggestion is to add a text-field that functions as filter for the presets display in the listbox.
When this field is not-blank, then only Presets starting with the entered text are displayed.
The presets that are delivered with installation could begin with a special letter, e.g. "+" or "!"
Big Isch
 
Posts: 92
Joined: Mon Mar 12, 2007 1:34 pm
Location: Austria

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby nynaevelan on Tue Jun 30, 2009 1:30 pm

Big Isch wrote:Suggestion for Grouping of Presets

This is really a great tool with lots of capability and lost of presets. Such, some sort of grouping for
presets comes to mind, as already discussed in this topic.

My suggestion is to add a text-field that functions as filter for the presets display in the listbox.
When this field is not-blank, then only Presets starting with the entered text are displayed.
The presets that are delivered with installation could begin with a special letter, e.g. "+" or "!"


As an organizational maniac I agree with this suggestion. :D

Nyn
3.2x - Win7 Ultimate (Zen X-Fi 32GB/Zen 8GB/Zen Vision M 60GB)
Link to Favorite Scripts/Skins
nynaevelan
 
Posts: 4712
Joined: Thu Feb 08, 2007 4:07 am
Location: New Jersey, USA

Re: RegExp Find & Replace 3.5 w/ 101 presets (2009-06-18)[MM2+3]

Postby martialartsguy on Tue Jun 30, 2009 4:51 pm

Question here, and again I apologize for my lack of knowledge with regexp. I'd like to capitalize all the text (from: happy to: Happy) in all the following fields:

Tempo, Mood, Occasion, Quality

I use these a lot and sometimes forget to capitalize. I have presets set up for each one, but if I could run all four at once, that'd be excellent.
Each has the following setting:

Find What: ([\w\xDF-\xF6\xF8-\xFF\u0100-\u024F\u0400-\u04FF])([\w'\xDF-\xF6\xF8-\xFF\u0100-\u024F\u0400-\u04FF]*)
Replace with: UCase("$1") & LCase("$2")

Thanks for your help.
martialartsguy
 
Posts: 160
Joined: Mon Apr 03, 2006 2:11 pm
Location: Denver, CO

Re: RegSub Help

Postby GIL on Tue Jun 30, 2009 7:07 pm

The next version of the script would have somewhat simpler MapArrayEx function with which you could write the Replace with string directly, without specifying strings for replacement in the Find what field as it is in previous case. Here is its future use:
Code: Select all
MapArrayEx("$&", Array("\bI\b", "1", "\bII\b", "2", "\bIII\b", "3", "\bIV\b", "4", "\bV\b", "5"))


Thanks, That's what I need to modify from another fields than the one with the numbers

If you are interested for such syntax, I could publish the updated script with that function.

Yeah
Do you ever wish you could get the version 35.9 of this script from the year 2025?

By the way, you will have a problem with English word "I" with those replacements.


That's no problem, I'll be using this to detect Disc # from the path, so it would need to say "I" after the words (CD|Disc|Disk|Disco), you know.
GIL
 
Posts: 107
Joined: Sun Sep 07, 2008 3:46 pm

PreviousNext

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 4 guests