Page 32 of 109

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sun Mar 07, 2010 12:12 pm
by Owyn
Here is one that has been bugging me for a while. I regularly need to get OrginalArtist from a title.
e.g.
Title: A Case Of You (Joni Mitchell cover)
Original Artist: Joni Mitchell

I have it working using 2 presets (plus a third to strip the info from title after I have checked results).
Preset110=Name: "Copy Title to OrigArtist", Description: "", Shortcut: "", Icon: "", Toolbar: False, FindWhat: "^.*", FindInto: "Original Artist", FindRegExp: True, WholeWord: False, ReplaceWith: "^.*", ReplaceFrom: "Title", ReplaceRegExp: True, ReplaceVBScr: False, MatchCase: False
Preset111=Name: "Pull origartist from title: Thirteen (Big Star cover)->Big Star", Description: "", Shortcut: "", Icon: "", Toolbar: False, FindWhat: "(^.*\()(.*)( cover\))", FindInto: "Original Artist", FindRegExp: True, WholeWord: False, ReplaceWith: "$2", ReplaceFrom: "Title", ReplaceRegExp: False, ReplaceVBScr: False, MatchCase: False
Try as I might I can not get these two presets combined into one operation without resorting to VBScript.

Any ideas?

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sun Mar 07, 2010 1:01 pm
by SpritHansi
Thanks :D

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sun Mar 07, 2010 1:26 pm
by Guest
Owyn wrote:Here is one that has been bugging me for a while. I regularly need to get OrginalArtist from a title.
Replace with: ^.*
Into: Original Artist
Regexp 1: checked
Replace with: RegExp(oSongData.Title, "[^\(]*(?= cover\))", 0)
VBScript: checked

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sun Mar 07, 2010 1:46 pm
by Owyn
Ahhh! :lightbulb:
Thanks. :D

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Thu Mar 11, 2010 12:13 pm
by -SuperFunk-
Because I don't know much about programming etc, i want to ask what i've got to do:

on allmusic.com I browse albums to copy the column of 'styles' into the MM-field 'grouping'
I get then:
* Album Rock
* Contemporary Pop/ Rock
* Rock & Roll
Then I adjusted the command to change * to ;
the result is:
; Album Rock
; Contemporary Pop/ Rock
; Rock & Roll
What do I need to do to get this:
Album Rock; Contemporary Pop/ Rock; Rock & Roll
- Remove the first ;
- Delete " " (the space before every ; )

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Fri Mar 12, 2010 6:40 pm
by buckw
This looks like an extremely useful script, but I am having a little trouble with insatllation. Specifically, I receive the following error code: 800A01F4. The specific error is "Variable is undefined 'SDB'", at line 1101, character 5. I would appreciate your help in resolving the problem.

Thank you.

Edit: Never mind! I just downloaded with Firefox and all is well. Thanks!

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sat Mar 13, 2010 3:20 pm
by Guest
-SuperFunk- wrote:What do I need to do to get this:
Album Rock; Contemporary Pop/ Rock; Rock & Roll
- Remove the first ;
- Delete " " (the space before every ; )
How do you have multiple lines of text inside of the Grouping field? AFAIK, Grouping field is just single-line. Anyway, you could try this:
Find what: ^;\s?|\s*(?=;)
Regexp 1: checked
Replace with: empty

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sat Mar 13, 2010 3:36 pm
by -SuperFunk-
Guest wrote:
-SuperFunk- wrote:What do I need to do to get this:
Album Rock; Contemporary Pop/ Rock; Rock & Roll
- Remove the first ;
- Delete " " (the space before every ; )
How do you have multiple lines of text inside of the Grouping field? AFAIK, Grouping field is just single-line. Anyway, you could try this:
Find what: ^;\s?|\s*(?=;)
Regexp 1: checked
Replace with: empty
By copying the styles-column from allmusic in the grouping-field i get multiple lines, Don't ask me why :)
Thanks for your help, it worked. I'm very happy.

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sat Mar 13, 2010 4:10 pm
by Guest
-SuperFunk- wrote:By copying the styles-column from allmusic in the grouping-field i get multiple lines
By the way, you could do previous two steps (replacing "*" with ";" and removing " ") with just single preset:
Find what: (^\*\s*)|(\s+\*)
Regexp 1: checked
Replace with: MapArray(Array("$1", "", "$2", ";"))
VBScript: checked

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Sat Mar 13, 2010 5:46 pm
by -SuperFunk-
Guest wrote:
-SuperFunk- wrote:By copying the styles-column from allmusic in the grouping-field i get multiple lines
By the way, you could do previous two steps (replacing "*" with ";" and removing " ") with just single preset:
Find what: (^\*\s*)|(\s+\*)
Regexp 1: checked
Replace with: MapArray(Array("$1", "", "$2", ";"))
VBScript: checked
Thanks! :)

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Tue Mar 23, 2010 8:56 pm
by boboberri2
Hi can somebody please explain to me how this thing works?
Really simple, like I'm in kindergarten.

I have thousands of files that got renamed with the artist name in the title, so the titles all go, "artist name - song title." Is there any way to replace all of them at once by searching for everything up to and including the dash and the space that follows it? Or do I have to do each artist one at a time? Thanks for any help.

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Wed Mar 24, 2010 3:37 am
by Guest
boboberri2 wrote:Is there any way to replace all of them at once by searching for everything up to and including the dash and the space that follows it? Or do I have to do each artist one at a time?
Yes, you could replace all of them at once. First, you should take a look at which presets already exist. Your description is not very clear, but I suppose you could use the "Remove the artist name from the Title" preset. Actually, it removes anything in the front of the Title before (and including) the dash, not matter if it is really the artist name or not. If you want to be sure to remove only string part which is exactly same as the artist name, then you could create a new preset with the following settings:
Find what: ^(.*?-\s*)
Into: Title
Regexp 1: checked
Replace with: IIf(Len(RegExp("$&", "^" & RegSub(oSongData.ArtistName, "(\W)", "\$$1") & "\s*-\s*", 0)) > 0, "", "$&")
VBScript: checked

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Wed Mar 31, 2010 10:43 am
by -SuperFunk-
I have a new question:

I have added multiple music-styles to the grouping field, separated by ;
eg

Code: Select all

Cuban Jazz; World Fusion; Latin Jazz; Afro-Cuban Jazz; Post-Bop
Now I want to generate auto-playlists for every genre I have, (by defining that the grouping field must contain the name of the genre)
I encountered a problem:
for the playlist 'Cuban Jazz' I get following item that doesn't belong in the list:
Afro-Cuban Jazz; Post-Bop; Latin Jazz; Cool; World Fusion
-> no 'Cuban Jazz' here, but because of 'Afro-Cuban Jazz; this item is added to the playlist

I have thought about a possible solution, and the only thing I can think about is that I give 'Cuban Jazz' an alternative name, let's say 'Kuban Jazz'
but how do i have to fill in the command lines in this script to make this possible?
I don't want the script to change the 'Afro-Cuban Jazz' to 'Afro-Kuban Jazz' ,
only 'cuban jazz' to 'Kuban jazz'

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Wed Mar 31, 2010 8:36 pm
by Guest
-SuperFunk- wrote:I want to generate auto-playlists for every genre I have, (by defining that the grouping field must contain the name of the genre)
I encountered a problem:
for the playlist 'Cuban Jazz' I get following item that doesn't belong in the list:
Afro-Cuban Jazz; Post-Bop; Latin Jazz; Cool; World Fusion
-> no 'Cuban Jazz' here, but because of 'Afro-Cuban Jazz; this item is added to the playlist
Did you try to specify: Grouping - contains - "; Cuban Jazz", and Grouping - starts with - "Cuban Jazz" with Match Any?

Re: RegExp Find & Replace 3.6 w/ 101 presets (2009-07-02)[MM2+3]

Posted: Thu Apr 01, 2010 2:55 am
by -SuperFunk-
Guest wrote:
-SuperFunk- wrote:I want to generate auto-playlists for every genre I have, (by defining that the grouping field must contain the name of the genre)
I encountered a problem:
for the playlist 'Cuban Jazz' I get following item that doesn't belong in the list:
Afro-Cuban Jazz; Post-Bop; Latin Jazz; Cool; World Fusion
-> no 'Cuban Jazz' here, but because of 'Afro-Cuban Jazz; this item is added to the playlist
Did you try to specify: Grouping - contains - "; Cuban Jazz", and Grouping - starts with - "Cuban Jazz" with Match Any?
Yes, but that wouldn't solve my problem.
the following item won't be added to the list
Cuban Pop; Alternative/ Indie Rock; Adult Alternative Pop/ Rock; Contemporary Pop/ Rock; Cuban Traditions; Cuban Jazz; Latin Jazz; World Fusion
-> no 'Afro-cuban jazz', only 'Cuban Jazz' but the line doesn't begin with 'cuban jazz'

I need to rename the 'cuban Jazz' to something alternative, but I want the rest of the style-tags to be unchanged (especially afro-cuban jazz in this example)
Can this script recognize the styles separated by ; so that it only takes 'cuban jazz' but not 'afro-cuban jazz' and then change it easily to an alternative?

NOTE: I have also other problems like 'electronic' vs 'experimental electronic' vs 'experimental'
-> I need a solution for this.