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

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderadores: Peke, Gurus

Owyn
Mensajes: 2018
Registrado: Vie Mar 21, 2008 10:55 am

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

Mensaje por 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?
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
SpritHansi
Mensajes: 57
Registrado: Dom Jun 18, 2006 4:43 pm

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

Mensaje por SpritHansi »

Thanks :D
Regards
SpritHansi
Invitado

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

Mensaje por Invitado »

Owyn escribió: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
Owyn
Mensajes: 2018
Registrado: Vie Mar 21, 2008 10:55 am

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

Mensaje por Owyn »

Ahhh! :lightbulb:
Thanks. :D
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
-SuperFunk-
Mensajes: 45
Registrado: Mar Ago 05, 2008 4:16 pm

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

Mensaje por -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 ; )
buckw
Mensajes: 26
Registrado: Mar Ago 21, 2007 3:08 pm

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

Mensaje por 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!
Invitado

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

Mensaje por Invitado »

-SuperFunk- escribió: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
-SuperFunk-
Mensajes: 45
Registrado: Mar Ago 05, 2008 4:16 pm

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

Mensaje por -SuperFunk- »

Guest escribió:
-SuperFunk- escribió: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.
Invitado

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

Mensaje por Invitado »

-SuperFunk- escribió: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
-SuperFunk-
Mensajes: 45
Registrado: Mar Ago 05, 2008 4:16 pm

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

Mensaje por -SuperFunk- »

Guest escribió:
-SuperFunk- escribió: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! :)
boboberri2

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

Mensaje por 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.
Invitado

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

Mensaje por Invitado »

boboberri2 escribió: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
-SuperFunk-
Mensajes: 45
Registrado: Mar Ago 05, 2008 4:16 pm

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

Mensaje por -SuperFunk- »

I have a new question:

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

Código: Seleccionar todo

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'
Invitado

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

Mensaje por Invitado »

-SuperFunk- escribió: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?
-SuperFunk-
Mensajes: 45
Registrado: Mar Ago 05, 2008 4:16 pm

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

Mensaje por -SuperFunk- »

Guest escribió:
-SuperFunk- escribió: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.
Responder