Page 37 of 109
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Tue Jun 01, 2010 9:52 am
by davidbspalding
I'm not sure why we have the
Move files to <Genre>\<Artist>\<Album>\<Track#> - <Title>.ext preset ... MM has a great Auto-Organize feature which supports strings like "..\<genre>\<artist>\<album>\<track#> - <title>" ?
Or was that for users of MM2 (which I haven't used, so I'm not familiar with the feature set)?
___________________
Apologies if this is evident from utilizing two presets in serial.... I searched the the thread and couldn't find this use case.
I want to populate the Lyrics field with the contents of the Composer field surrounded by "(" and ")" characters. Currently I have a few lyrics which appear like so
I'm not in love, so don't forget it
It's just a silly phase I'm going through...
I'd like to populate Lyrics which DON'T have composers with Composer like so
(D. Gamble; G. Gouldman; R.L. Martin)
I'm not in love, so don't forget it
It's just a silly phase I'm going through...
I may also want to delete the first line of the Lyrics which already have (inaccurate) composer info and then rewrite with the correct values which WMPlayer downloaded from AMG. I think existing presets would do that just fine (search and delete first line up to and including first \n).
Any suggestions welcome. (Including how to craft a RegExp or VBasic string from scratch.

)
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Tue Jun 01, 2010 11:38 am
by ZvezdanD
You sent me a PM, but you have disabled their receipt and I cannot answer you in PM, so there is my answer here.
davidbspalding wrote:Regexp find & replace 4.0.3
Preset name misspelling:
Exctract Album Artist from last folder of Path (e.g. ..\Album artist - Album\Title.mp3)
change to
Extract Album Artist from last folder of Path (e.g. ..\Album artist - Album\Title.mp3)
Keep on truckin', this is a superb plugin!

Actually, this preset name is already fixed in 4.0.3. You probably have installed both presets now. Thanks for the report anyway
By the way, I think that I already told this, but I will repeat. My suggestion with installation (especially after I change something drastically with them or if I have added many new ones) is to first make a backup of presets with old version, remove all presets using Export/Import dialog, and then install new version of add-on. After you finish with installation you could import back your own created presets. This is because from time to time I improve some existing presets, but keep their names intact and since this add-on during installation checks only their names, it will skip installation of such improved presets.
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Tue Jun 01, 2010 12:25 pm
by davidbspalding
Ah, thanks for the reminder, I didn't do that. Will do so now..... I didn't have any customized settings, so the "upgrade" asked about adding new ones to existing presets and I accepted that.
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Tue Jun 01, 2010 12:28 pm
by ZvezdanD
davidbspalding wrote:I'm not sure why we have the Move files to <Genre>\<Artist>\<Album>\<Track#> - <Title>.ext preset ... MM has a great Auto-Organize feature which supports strings like "..\<genre>\<artist>\<album>\<track#> - <title>" ?
If you don't like some preset, you could remove it easily. In my opinion, it is much better if there are many presets, even if you don't need them all, then to have their limited number.
The mentioned preset is just simple example how someone could rename/move files according to existing tags, similar to built-in Auto-Organize option. Yes, that option is great, however there are many things that you cannot do with it, but you could do with this add-on. For example, you could take a look at "Append weighted average Bitrate of album to the last folder of Path" or "Add "Disc #" as last folder only if some song from album has Disc number >= 2" or many other similar presets which cannot be simulated with Auto-Organize option.
davidbspalding wrote:I want to populate the Lyrics field with the contents of the Composer field surrounded by "(" and ")" characters. Currently I have a few lyrics which appear like so
I'm not in love, so don't forget it
It's just a silly phase I'm going through...
I'd like to populate Lyrics which DON'T have composers with Composer like so
(D. Gamble; G. Gouldman; R.L. Martin)
I'm not in love, so don't forget it
It's just a silly phase I'm going through...
Well, If you want to add something to Lyrics, I think it should be Lyricist, not Composer. Anyway:
Find what: ^
Into: Lyrics
Regular expression 1: checked
Replace with: IIf(Len("$_") > 0 And Len(oSongData.Author) > 0 And Left("$_", Len(oSongData.Author) + 2) <> "(" & oSongData.Author & ")", "(" & oSongData.Author & ")" & vbNewLine & vbNewLine, "")
VBScript expression: checked
davidbspalding wrote:I may also want to delete the first line of the Lyrics which already have (inaccurate) composer info
Find what: ^\(.*?\)(\r\n)+
Into: Lyrics
Regular expression 1: checked
Replace with: empty
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Sat Jun 05, 2010 5:27 pm
by davidbspalding
ZvezdanD wrote:davidbspalding wrote:... I want to populate the Lyrics field with the contents of the Composer field surrounded by "(" and ")" characters. Currently I have a few lyrics which appear like so
I'm not in love, so don't forget it
It's just a silly phase I'm going through...
I'd like to populate Lyrics which DON'T have composers with Composer like so
(D. Gamble; G. Gouldman; R.L. Martin)
I'm not in love, so don't forget it
It's just a silly phase I'm going through...
Well, If you want to add something to Lyrics, I think it should be Lyricist, not Composer. Anyway:
Find what: ^
Into: Lyrics
Regular expression 1: checked
Replace with: IIf(Len("$_") > 0 And Len(oSongData.Author) > 0 And Left("$_", Len(oSongData.Author) + 2) <> "(" & oSongData.Author & ")", "(" & oSongData.Author & ")" & vbNewLine & vbNewLine, "")
VBScript expression: checked
Beautiful, and it can be easily modified to use the Lyricist tag should that be populated (oSongData.Lyricist).[1] And learning some new features of your plug-in. Many thanks.
[1] I may start looking into using this to populate the Lyricist tag....
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Mon Jun 07, 2010 6:41 am
by davidbspalding
I couldn't find a post or image listing all 60+ icons available for display of presets on the toolbar, is one available?
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Mon Jun 07, 2010 6:00 pm
by ZvezdanD
davidbspalding wrote:I couldn't find a post or image listing all 60+ icons available for display of presets on the toolbar, is one available?
http://www.mediamonkey.com/wiki/index.p ... rces#Icons
RegExp script help?
Posted: Tue Jun 15, 2010 1:33 am
by Spades68
Filename: 04-drowning_pool-reborn.mp3
That is the problem, I've got plenty of tracks like that and I need to fix them.
What Needs to be Done
1.) Removal of "_ and -"
2.) Capitalize main words (maybe there's already a script for that)
Re: RegExp script help?
Posted: Tue Jun 15, 2010 11:18 am
by ZvezdanD
Spades68 wrote:1.) Removal of "_ and -"
Choose the "Replace specified string with another one in <Into Field>..." preset.
Spades68 wrote:2.) Capitalize main words (maybe there's already a script for that)
Choose the "Capitalize <Into Field> (ASCII, Latin-1, Latin-2 & Cyrillic)..." preset.
If you are using Edit / Tag Manipulation Presets menu, you should specify Filename in the
Destination field dropdown list when you get the preset's dialog box. If you are using the RegExp Find and Replace dialog box, you should specify Filename in the
Into dropdown list.
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Sun Jun 20, 2010 4:47 pm
by dollarxgeneral
I'm trying to get an expression that is mostly like the "Assign Genre if it is different from value assigned to most tracks from same album" expression but instead of the album I want it to be the artist.
For example, I have artists with sometimes multiple genres that I want to consolidate to the same genre that have several different albums/soundtracks/compilations.
I may have an artist with the genre "Indie Rock" on the studio albums but there might be a soundtrack that they're on that's still labeled "soundtrack" as the genre. I want to take the genre that is most prevalent in the artist and assign it to all tracks.
Another awesome thing would be if it could exclude certain genres from being renamed because some of the artists I have multiple genres on purpose.
I would do it manually but I have 39,000 tracks, 4,000 artists, and 55 genres so it would take forever to do it manually.
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Sun Jun 20, 2010 7:37 pm
by ZvezdanD
dollarxgeneral wrote:I'm trying to get an expression that is mostly like the "Assign Genre if it is different from value assigned to most tracks from same album" expression but instead of the album I want it to be the artist.
You could try the next
Replace with string:
Code: Select all
IfNull(SQLQuery("SELECT Genre, Count(Genre) AS SortField FROM Songs WHERE Artist = '" & Replace(oSongData.ArtistName, "'", "''") & "' AND Genre <> '' GROUP BY Genre ORDER BY SortField DESC"), "$&")
dollarxgeneral wrote:Another awesome thing would be if it could exclude certain genres from being renamed because some of the artists I have multiple genres on purpose.
I am not sure that understand that requirement. If you want to exclude some specific genre from renaming, e.g. Rock, you could use something like this:
Code: Select all
IIf(oSongData.Genre = 'Rock', "$&", IfNull(SQLQuery("SELECT Genre, Count(Genre) AS SortField FROM Songs WHERE Artist = '" & Replace(oSongData.ArtistName, "'", "''") & "' AND Genre <> '' GROUP BY Genre ORDER BY SortField DESC"), "$&"))
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Mon Jun 21, 2010 9:01 pm
by panzerq242
Would it be possible to make a mask to leave the first genre in the "Genre" field but move the rest to the "Grouping" field?
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Tue Jun 22, 2010 5:44 pm
by ZvezdanD
panzerq242 wrote:Would it be possible to make a mask to leave the first genre in the "Genre" field but move the rest to the "Grouping" field?
Yes, but only with two presets. The first one is to move the rest to the "Grouping" field:
Find what: ^.*
Into: Grouping
Regular expression 1: checked
Replace with: RegExpEx(oSongData.Genre, ";\s?(.*)$", 0, 0)
VBScript expression: checked
The predefined preset "Remove all items from multi-item <Into Field> except first one..." could be used to leave the first genre in the "Genre" field - just specify Genre as the
Into (Destination) field.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Sat Jul 03, 2010 7:13 pm
by UncleBoarder
Replacing the content of the path field doesn't work if the new path is a cname...
ZvezdanD wrote:Okram wrote:I only have one suggestion: on folders it doesn't actually replace them but it creates new folders. It would be useful if, when renaming, it would also delete emptied (old) folders at the same time.
Sorry, but this is not its purpose. All it should do is to replace content of the Path field, remaining job is internal to MediaMonkey itself. So, I think you should report this to the Bug or Wishlist forum of MM.
[/quote]
My library knows my files as //10.0.0.91/Storage/Music....
I want to change them to //NAS/Storage/Music....
Since this is not actually moving the files, it's just a host name to the same location, MM complains. "An error occurred moving file //10.0.0.91/Storage/Music...."
I assume this is occurring because it's trying to write a file where one already exists? Anyway, as you say, this should just replace the content of the Path field. So why is it checking anything? Can it be set to just change the path without checking? Let it trust me.... I know where my files are.

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Sun Jul 04, 2010 2:55 am
by ZvezdanD
UncleBoarder wrote:I assume this is occurring because it's trying to write a file where one already exists? Anyway, as you say, this should just replace the content of the Path field. So why is it checking anything? Can it be set to just change the path without checking?
Well, it is not my add-on which moves and checks the files during the Path modification, but it is the program itself. However, I have one another suggestion - you could try to change the database content directly using the SQL's UPDATE command. You could use Bex's SQL Viewer add-on or some SQLite specific software like SQLiteSpy to execute that command. Here is the SQL command for your case:
Code: Select all
UPDATE Songs SET SongPath = Replace(SongPath, '//10.0.0.91/', '//NAS/')
I strongly suggest making a backup of the database file first.