Page 69 of 109

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

Posted: Mon Jun 15, 2015 6:41 pm
by MMFrLife
Whoa!!! Looks like the Z man is doing his rain dance again and makin' it rain presets!
Thanks! I'll have to look into some of those and post back here later.

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

Posted: Mon Jun 15, 2015 6:46 pm
by MMFrLife
terrypin wrote:So it sounds like the RegEx used by the add-on differs in syntax or functionality in some way.
Yes, I figured as much. With Z's confirmation, it looks to be the case.

Thanks again, though!

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

Posted: Thu Jun 25, 2015 11:34 am
by MMFrLife
I've tried out the first preset and got it to work great. It is saved in my preset menu now. I haven't tried out the other ones but looking forward to
coming across the need, to see if they work. I'll edit back here if I do.

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

Posted: Mon Jul 27, 2015 10:06 pm
by pintree3
Is there a way to back this up? I'm moving country and won't be taking my PC with me--hence will need to reinstall my MM once I get a new one.
I love this plugin--what a godsend :-) Seeing that about 2/3 of the commands I don't use I deleted them, and I modified a few of the others. I would hate to do it all over again hence me asking--and if it is possible to save them, can they migrate to the new version 4.4?

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

Posted: Tue Jul 28, 2015 4:42 am
by Camus II
The presets that are in use via Edit > Tag Manipulation Presets are stored in ..\AppData\Roaming\MediaMonkey\MediaMonkey.ini under the heading [RegExpPresets]. So just keep a back up copy of MediaMonkey.ini (or keep a separate text copy of your presets) and then you can copy and paste the [RegExpPresets] settings from that into any other/future installations.

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

Posted: Tue Jul 28, 2015 2:16 pm
by pintree3
Camus II wrote:The presets that are in use via Edit > Tag Manipulation Presets are stored in ..\AppData\Roaming\MediaMonkey\MediaMonkey.ini under the heading [RegExpPresets]. So just keep a back up copy of MediaMonkey.ini (or keep a separate text copy of your presets) and then you can copy and paste the [RegExpPresets] settings from that into any other/future installations.
I'm sure I had replied to this thanking you but I can't seem to see my reply--sorry but I did.
Anyhow another question popped up, or rather a part of my 1st question. I had asked what happens since there is now a new version?
You may have answered this but let me ask again and then go back to what may have been your answer.
Could I assume that if I install the new 4.4 version on top of this one all my previous deletes and modifications will be lost? OR if I back up my settings now and then in my new system install the new version, and then after this, replace my present .ini file then I would screw things up, wouldn't I?
Assuming yes to both, would it be safe to assume that installing a new version will automatically any changes made? or is there a way around this?
About your answer, you wrote, "or keep a separate text copy of your presets" I found that part in the .ini file. If I install the new version will changing this part alone affect anything else?

Thanks again

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

Posted: Tue Jul 28, 2015 2:42 pm
by ZvezdanD
Here is the excerpt from the Installation section of the first post of this thread (and from the add-on's Web page in that matter):
"If you are upgrading this add-on from some old version, especially if there is updated syntax of presets, it is strongly recommend to follow these steps:
1. make a backup of your own created presets using the Edit / RegExp Export/Import dialog box;
2. uninstall old version of add-on and choose Yes when you are asked if you want to remove add-on settings;
3. install the new version of add-on;
4. import your own created presets using the Edit / RegExp Export/Import dialog box.

In that way you would always have the latest and updated presets. If you don't remove old settings (together with presets), during the installation this script would check the preset's names and if they are same as old ones it would skip their installation, even if they are updated."

The add-on's menu is modified in the 4.4 version. So, when you want to import presets, instead of Edit / RegExp Export/Import option there is now Edit / RegExp Find and Replace / Manage Presets option (now it could be found in the popup menus and the toolbar as well). When I am already at it, maybe I should mention that instead of Edit / RegExp Find and Replace option now you could use Edit / RegExp Find and Replace / Preset Settings option to get the same RegExp main dialog box.

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

Posted: Fri Aug 07, 2015 12:04 pm
by Haaden2
This is a great add-on! Having one spot of trouble, though:

Getting "Expression Error!" using Preset 155 Remove duplicate items in multi-item <Into Field>.... I have not modified the preset.

Code: Select all

Preset155=Name: "Remove duplicate items in multi-item <Into Field>...", Description: "Rock; Prog-Rock; Rock; Art Rock -> Rock; Prog-Rock; Art Rock", Shortcut: "", Icon: "", Toolbar: 0, FindWhat: "^.*", FindInto: "Genre", FindRegExp: 1, WholeWord: 0, ReplaceWith: "Execute(""Dim aItems, bMatch, sField, ii, jj: aItems = Split(Replace(sBefore, """"; """", """";""""), """";""""): For ii = 0 To UBound(aItems): bMatch = False: For jj = 0 To ii - 1: If aItems(jj) = aItems(ii) Then bMatch = True: Exit For: End If: Next: If Not bMatch Then sField = sField & aItems(ii) & """"; """": End If: Next: If Len(sField) Then sField = Left(sField, Len(sField) - 2) End If: iVariable(0) = sField"") & iVariable(0)", ReplaceFrom: "Title", ReplaceRegExp: 0, ReplaceVBScr: 1, MatchCase: 0
Maybe there's a simple tweak I need to make?

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

Posted: Fri Aug 07, 2015 12:45 pm
by ZvezdanD
Haaden2 wrote:Getting "Expression Error!" using Preset 155 Remove duplicate items in multi-item <Into Field>....
I cannot try it right now, so let me know if this works:

Code: Select all

Preset155=Name: "Remove duplicate items in multi-item <Into Field>...", Description: "Rock; Prog-Rock; Rock; Art Rock -> Rock; Prog-Rock; Art Rock", Shortcut: "", Icon: "", Toolbar: 0, FindWhat: "^.*", FindInto: "Genre", FindRegExp: 1, WholeWord: 0, ReplaceWith: "Execute(""Dim aItems, bMatch, sField, iItem, jItem: aItems = Split(Replace(sBefore, """"; """", """";""""), """";""""): For iItem = 0 To UBound(aItems): bMatch = False: For jItem = 0 To iItem - 1: If aItems(jItem) = aItems(iItem) Then bMatch = True: Exit For: End If: Next: If Not bMatch Then sField = sField & aItems(iItem) & """"; """": End If: Next: If Len(sField) Then sField = Left(sField, Len(sField) - 2) End If: SetVar 0, sField"") & GetVar(0)", ReplaceFrom: "Title", ReplaceRegExp: 0, ReplaceVBScr: 1, MatchCase: 0

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

Posted: Wed Aug 12, 2015 7:32 am
by MMFrLife
I like setting the track numbers for multi-disc releases (2+ discs) consecutively (ex.: if discs contain 10 tracks each, track order would run 09, 10, 11, 12, 13 .....).

However, I also like to keep a record of what the original track ordering is per disc at the end of the filename and title field, ex.: filename =
It's a Party Tonight [01_01].mp3. . That is where [01_01] = Disc 1, track 1.

I can already achieve this, but it takes multiple steps (some of which, I'm guessing, can't be avoided). Provided the track numbers are already set with a leading
zero, the disc # is then set (with leading zero for 1 - 9) and I hold off on the consecutive tracking and copy filename to the title until the end, is there a way to get at least the "[01_01]" part done in a single step?

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

Posted: Fri Aug 14, 2015 11:09 am
by ZvezdanD
MMFrLife wrote:I like setting the track numbers for multi-disc releases (2+ discs) consecutively (ex.: if discs contain 10 tracks each, track order would run 09, 10, 11, 12, 13 .....).

However, I also like to keep a record of what the original track ordering is per disc at the end of the filename and title field, ex.: filename =
It's a Party Tonight [01_01].mp3. . That is where [01_01] = Disc 1, track 1.

I can already achieve this, but it takes multiple steps (some of which, I'm guessing, can't be avoided). Provided the track numbers are already set with a leading
zero, the disc # is then set (with leading zero for 1 - 9) and I hold off on the consecutive tracking and copy filename to the title until the end, is there a way to get at least the "[01_01]" part done in a single step?
You should have initially filed the original Disc # and Track #, then you could append that data to the end of e.g. Title and just then you could eventually modify Track # to have consecutive numbers for all multi-discs.

Preset: Append [Disc #_Track #] to the <Into Field>...
Description: With leading zeroes to the single-digit Disc and Track numbers
Find what: $
Regular expression 1: checked
Replace with: IIf(Len("$_") > 0, " ", "") & "[" & Right("00" & oSongData.DiscNumberStr, 2) & "_" & Right("00" & oSongData.TrackOrderStr, 2) & "]"
VBScript expression: checked

The next part could be done in two ways: using the total number of tracks from each disc or using the maximal Track # from each disc (if you have discs with all tracks and if they all have correctly filled the Track # info, then these two presets would give the same result).

Preset: Make consecutive Track # for multi-disc albums using total number of tracks from each disc
Description: If first disc has 8 tracks, Disc # = 2 and Track # = 1 -> Track # = 9
Find what: ^.*
Into: Track #
Regular expression 1: checked
Replace with: oSongData.TrackOrderStr + IIf(Int("0" & oSongData.DiscNumberStr) > 1, SQLQuery("SELECT Count(*) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " AND DiscNumber < 0" & oSongData.DiscNumberStr & " GROUP BY IDAlbum"), 0)
VBScript expression: checked

If you want to use the next preset, it is very important that you sort tracks in the main tracklist by descending order of Disc # before selecting tracks and applying the preset:
Preset: Make consecutive Track # for multi-disc albums using maximal Track # from each disc
Description: If Track # of the last track from the first disc is 8, Disc # = 2 and Track # = 1 -> Track # = 9
Find what: ^.*
Into: Track #
Regular expression 1: checked
Replace with: oSongData.TrackOrderStr + IIf(Int("0" & oSongData.DiscNumberStr) > 1, SQLQuery("SELECT Sum(MaxNo) FROM (SELECT Max(CAST(TrackNumber AS integer)) AS MaxNo FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " AND DiscNumber < 0" & oSongData.DiscNumberStr & " GROUP BY IDAlbum, DiscNumber)"), 0)
VBScript expression: checked

Finally, you could clear the Disc # using the existing "Clear <Into Field>..." preset or assign 1 to all tracks.

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

Posted: Sun Aug 16, 2015 8:50 pm
by dtsig
I am looking through trying to figure a way to change <title> to actually contain "S"01"E"01 Title of video

So if now TITLE="Love is Beautiful" and Season# = 1 and Episode# = 1 then I want title to be:

S01E01 Love is Beautiful

I am sure that this can do it but haven't figured how to replace an attribute with combined attributes.

Help would be very welcomed

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

Posted: Mon Aug 17, 2015 7:04 am
by ZvezdanD
dtsig wrote:I am looking through trying to figure a way to change <title> to actually contain "S"01"E"01 Title of video
Preset: Add Season # and Episode # to the begin of <Into Field>...
Description: With leading zeroes to the single-digit Season and Episode numbers
Find what: ^.*
Into: Title
Regular expression 1: checked
Replace with: "S" & Right("0" & oSongData.SeasonNumber, 2) & "E" & Right("0" & oSongData.EpisodeNumber, 2) & IIf(Len("$&") > 0, " $&", "")
VBScript expression: checked

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

Posted: Mon Aug 17, 2015 8:10 am
by dtsig
ZvezdanD wrote:
dtsig wrote:I am looking through trying to figure a way to change <title> to actually contain "S"01"E"01 Title of video
Preset: Add Season # and Episode # to the begin of <Into Field>...
Description: With leading zeroes to the single-digit Season and Episode numbers
Find what: ^.*
Into: Title
Regular expression 1: checked
Replace with: "S" & Right("0" & oSongData.SeasonNumber, 2) & "E" & Right("0" & oSongData.EpisodeNumber, 2) & IIf(Len("$&") > 0, " $&", "")
VBScript expression: checked
WOW .. thanks man .. what a great guy you are .. cheers ..

EDITED: And of course this worked perfectly .. thanks again.

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

Posted: Wed Aug 19, 2015 7:57 am
by MMFrLife
ZvezdanD wrote:You should have initially filed the original Disc # and Track #, then you could append that data to the end of e.g. Title and just then you could eventually modify Track # to have consecutive numbers for all multi-discs.

Preset: Append [Disc #_Track #] to the <Into Field>...
Description: With leading zeroes to the single-digit Disc and Track numbers
Find what: $
Regular expression 1: checked
Replace with: IIf(Len("$_") > 0, " ", "") & "[" & Right("00" & oSongData.DiscNumberStr, 2) & "_" & Right("00" & oSongData.TrackOrderStr, 2) & "]"
VBScript expression: checked
Exactly what I was looking for!!! It worked like a charm. The other two look interesting as well. Thanks again. You're the man! 8)