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

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

Moderators: Peke, Gurus

MMFrLife
Posts: 2894
Joined: Fri Oct 26, 2012 9:04 pm
Location: MM Forum

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

Post by MMFrLife »

"Specific section"!!!

:o :o :o YAY!!!
Wow, that opens up a whole other possibility.

I always wondered why "|BlueRay|iTunes" was sittin' over there to the left.
It's intro'd with "String Caption" like the other sections, but "Specific" after it threw
me as to the fact that it is yet another adjustable section :lol: Yay! :D .
ZvezdanD wrote: :wink: I didn't want to enter into another discussion why you are wrong, but here are again some examples what could happen if you use your mod with the "-" as a word character: Afro-celt, Dark-eyed, Jean-michel, Kung-fu, Itsy-bitsy, Low-life, Non-stop, Ob-la-di, P-funk, Pan-african, Peek-a-boo, Pin-ups, Radio-activity,
Rendez-vous, Set-up, Too-rye-ay, Trans-europa, White-out, X-ray...
Ok, no biggie. But what I meant by remaining point was that I already demonstrated an awareness of the
problem of counter-instructing a repeated character in my previous 2 posts (earlier in the string, later
in the string and trying fresh, the original preset with stripped out symbols). So, sure, not a "full" understanding,
but an awareness.

I mean, the Lowercase section, although it has some strings with "?" and "\", it also has "specific",
normal looking strings like "into, for, from (which I added)". It also includes 2 character strings like,
"in" and "to". "lv" and "xb" are 2 character strings. I didn't include any symbols like "-" in my last test with the
original, unmodified preset and it still didn't work at the end. That and being unaware of a separate "specific" section
is why I was so confused.

When I mentioned giving up, I was only referring to how, now, I can't even seem to get the "Specific String"
thing to work. I didn't mean I was determined to make work what I originally, idealistically had in mind.
ZvezdanD wrote:For the third time, it is the Specific section, not Lowercase.
Yes, third time referencing, first time combining those two terms "Specific section"
It wasn't incorrect before, it just confused me the way it was worded because the Lowercase section
also includes unique, specific strings and I was previously unaware of "Specific" as a "separate" section,
and in turn, unaware of its separate purpose.

It's all good now! :D
Hopefully this will help someone else as well.

Thanks,
Your the best when it comes to the MM scripting game! :wink:
MM user since 2003 (lifetime lic. 2012) "Trying to imagine life without music gives me a headache"
Top 2 scripts: RegExp Find & Replace (e.v.) and Magic Nodes (e.v.) ZvezdanD's scripts site
Please take a moment to read the bottom of the linked page to support the one and only - ZvezdanD! (the "originator" since 2006).
MMW 4.1.31.1919; 5.0.4.2690 || back it up...frequently!
|| software for power users: "Q-Dir" (free alt. to explorer) and file/folder renamer: "ReNamer" (den4b)
"The absurd is the essential concept and the first truth"
😜
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

MMFrLife wrote:the Lowercase section
also includes unique, specific strings and I was previously unaware of "Specific" as a "separate" section
I suppose you didn't open the Tune/Adjustment dialog box for that preset, otherwise you would see it clearly separate.

I though to call it "Exact" or something like that, but decided for the "Specific" term.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
MMFrLife
Posts: 2894
Joined: Fri Oct 26, 2012 9:04 pm
Location: MM Forum

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

Post by MMFrLife »

ZvezdanD wrote:I suppose you didn't open the Tune/Adjustment dialog box for that preset, otherwise you would see it clearly separate.
Nope. It's one of the few preset types I haven't done that with.
I've had it in a couple of my editing process batches (1 with 3 instances and another with 1).

Yeah, it's tough as to what the name could be to help distinguish it.
"Special"
"Specialcase"
"SpecialSequence"
"Uncommon"
"Uncommoncase"
...and so on

You run into the same problem as "Exact" and Specific" where they all mean or imply the same things.
I mean, the fact that the preset has to do with "exceptions" already, and that there are only 2 cases (lower/upper),
makes a distinction difficult. The "Specific" section also has to do with (upper/lower), the distinction being different kinds of
arrangements/sequencing in where the usual rules of arrangement don't necessarily apply, like "first and last words capitalized", etc.

I settled on and customized mine with "OtherString". I tested out the adjustment/tune dialog and it looks nice in all dialogs!

Quick question:
On the advice you gave with using "|\d+D" for the ID "[2D]", I translated it to ",\d," inserting it into "[\-,\d,:;.,]\W*|[ \t]+".
It appears to work. Is that proper/advisable?
MM user since 2003 (lifetime lic. 2012) "Trying to imagine life without music gives me a headache"
Top 2 scripts: RegExp Find & Replace (e.v.) and Magic Nodes (e.v.) ZvezdanD's scripts site
Please take a moment to read the bottom of the linked page to support the one and only - ZvezdanD! (the "originator" since 2006).
MMW 4.1.31.1919; 5.0.4.2690 || back it up...frequently!
|| software for power users: "Q-Dir" (free alt. to explorer) and file/folder renamer: "ReNamer" (den4b)
"The absurd is the essential concept and the first truth"
😜
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

MMFrLife wrote:On the advice you gave with using "|\d+D" for the ID "[2D]", I translated it to ",\d," inserting it into "[\-,\d,:;.,]\W*|[ \t]+".
It appears to work. Is that proper/advisable?
I don't know what you want, but no, it is not proper. You are using one regular expression suggested for one specific case into another different place.

Here is a quick reference:
- "\d" is a regular expression that matches any digit;
- "+" is a quantifier that indicates one or more occurrences of the preceding element;
- so "\d+" means one or more digits;
- "[...]" is a regular expression that matches any single character specified inside those brackets, e.g. [Joe] means J OR o OR e;
- if you want to match any string with multiple characters you could use () brackets and | to alternate these characters, e.g. (Joe|John) means Joe OR John.
- however, the "(...)" brackets create capturing groups, their matches are often used as a reference in the Replace with string, so if you do not want to mess with that, you should use non-capturing (?:...) group instead with the "?:" following the opening bracket.

By the way, if you didn't know, when you click on the leftmost "?" button from the bottom row of controls you would get the short reference for the Regular expressions.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
MMFrLife
Posts: 2894
Joined: Fri Oct 26, 2012 9:04 pm
Location: MM Forum

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

Post by MMFrLife »

In regards to "[2D]"
"What It Takes - The Chess Years (Expanded Edition) -lv -xb [2D]"
results in "What It Takes - The Chess In Years (Expanded Edition) -lv -xb [2d]"

If I put "|d+D" at the end of Uppercase, like you advised in earlier discussion, it works great to keep it as "[2D]"
It works, no problem. :)

I just thought I would experiment using "([\-,:,;.,]\W*|[ \t]+" to see if I could get it to skip over the digit to the D, thus capping it.
"([\-,\d:;.,]\W*|[ \t]+"

So, is it actually wrong, even though it appears to work, because it will cause problems in other situations?
Or, not necessarily wrong, just "non-standard"?

MMfrLife wrote:to see if I could get it to skip over the digit to the D, thus capping it.
Is it even actually doing that in this case or does it just seem like it?
MM user since 2003 (lifetime lic. 2012) "Trying to imagine life without music gives me a headache"
Top 2 scripts: RegExp Find & Replace (e.v.) and Magic Nodes (e.v.) ZvezdanD's scripts site
Please take a moment to read the bottom of the linked page to support the one and only - ZvezdanD! (the "originator" since 2006).
MMW 4.1.31.1919; 5.0.4.2690 || back it up...frequently!
|| software for power users: "Q-Dir" (free alt. to explorer) and file/folder renamer: "ReNamer" (den4b)
"The absurd is the essential concept and the first truth"
😜
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

MMFrLife wrote:I just thought I would experiment using "([\-,:,;.,]\W*|[ \t]+" to see if I could get it to skip over the digit to the D, thus capping it.
"([\-,\d:;.,]\W*|[ \t]+"
Sorry, but I still don't understand what you want, and it seems that you didn't understand my description of the "[...]" regular expression either. You should put characters that you want to mach inside those brackets. A single characters. And they should not be separated by anything, e.g. [abc] or [123] or [@#$] or whatever. My suggestion was "[\-:;.,]\W*|[ \t]+" for something completely unrelated and even then I have a single "," inside those brackets, so I don't know why you put additional "," in there. Even less I understand why you put \d inside those brackets. Do you want words after a digit to be always capitalized or what?

Here is a purpose of my suggestion:
ZvezdanD wrote:
MMFrLife wrote:In "Caps with exceptions...", how do I also make articles after " - " capitalized?
You should replace "(?!^)\b" in the predefined preset with "[\-:;.,]\W*|[ \t]+". There are added ":;.," beside of "-" after which a word should be capitalized, you could also add some another characters inside the first pair of [] brackets if you want to have a word capitalized after them.
So, you wanted all words after " - " to be capitalized, even those exceptions in Lowercase group, but I expanded your request to the additional symbols because words after "." or ":" should be also always capitalized, as well after "!" or "?" (which I forgot to add). However, I am still in doubt if those exceptions like "the" should be capitalized after "," and ";". If you could find rules for that on Internet, please give me a link.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
MMFrLife
Posts: 2894
Joined: Fri Oct 26, 2012 9:04 pm
Location: MM Forum

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

Post by MMFrLife »

Sorry about the commas, I must of been thrown at one point because of the bottom part of the semi-colon and end comma,
thinking everything needed to be separated with a comma (an accidental illusion :lol: ; it was copied and pasted to the post).
So, forget about that. I took the extras out.

Also, I took out the "\d" and forget about the "\d+D" example I gave before (unless it applies again in the exact same form).
ZvezdanD wrote:So, you wanted all words after " - " to be capitalized, even those exceptions in Lowercase group, but I expanded your request to the additional symbols because words after "." or ":" should be also always capitalized, as well after "!" or "?" (which I forgot to add).
Yes, that is what I want. There isn't a problem with that the way it currently sits.

Let's just start with a fresh description:
ZvezdanD wrote:Do you want words after a digit to be always capitalized or what?
Well, I "mainly" want the letter D after a digit or number of digits to be capitalized, not necessarily "all" letters or words after.

ex. of what I want
"[2D]", "[3D]"..... or "[10D]", "[14D]".....

However, I would "ideally" like the possibility of maybe another letter or two, but I can do without
if that is a problem (like, maybe problematic if other letter is "A" ([2A], [3A], [23A]...), since it is
already in lowercase section. What happens if "A" is at beginning of title/name or after a digit "within" title or name;
counter-instructing problem again(?))
ZvezdanD wrote:However, I am still in doubt if those exceptions like "the" should be capitalized after "," and ";".
I would say no. They are minor breaks. Merely pauses (one quick and one slightly extended). They don't have the same prominence as
separators like "-", ":", "(", etc.
ZvezdanD wrote:If you could find rules for that on Internet, please give me a link.
Ok.


- I'm trying to convey best I can come up with, but if you still don't follow (for whatever reason; no fault of yours), I'm gonna have to take a break
from this particular issue for a while.
MM user since 2003 (lifetime lic. 2012) "Trying to imagine life without music gives me a headache"
Top 2 scripts: RegExp Find & Replace (e.v.) and Magic Nodes (e.v.) ZvezdanD's scripts site
Please take a moment to read the bottom of the linked page to support the one and only - ZvezdanD! (the "originator" since 2006).
MMW 4.1.31.1919; 5.0.4.2690 || back it up...frequently!
|| software for power users: "Q-Dir" (free alt. to explorer) and file/folder renamer: "ReNamer" (den4b)
"The absurd is the essential concept and the first truth"
😜
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

MMFrLife wrote:However, I would "ideally" like the possibility of maybe another letter or two, but I can do without
if that is a problem (like, maybe problematic if other letter is "A" ([2A], [3A], [23A]...), since it is
already in lowercase section. What happens if "A" is at beginning of title/name or after a digit "within" title or name;
counter-instructing problem again(?))
You could add "\d+[AD]" to the Uppercase section instead, adding whatever character you want to be after digits inside of these [] brackets. The Uppercase section matches only words since it is surrounded by \b anchors. So, if you specify "\d+[AD]" it will match 2A, 2D, 23A, 312D... It will match them anywhere in the field if they are surrounded by any non-word character, e.g. " 2A " or " 2A, " or "[2A]" or "(2A)"... It will not match 2AA because it has two A. If you want to match one or more characters, you should write "\d+[AD]+".
MMFrLife wrote:I would say no. They are minor breaks. Merely pauses (one quick and one slightly extended). They don't have the same prominence as
separators like "-", ":", "(", etc.
You are right. Here is the new update for the begin of Lowercase section "[\-:.!?][ \t]*|[ \t]+".
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

Preset: Replace LF with CR+LF in Lyrics
Description: A new line is represented as Line Feed character in Unix, but as Carriage Return + Line Feed characters in Windows.
Find what: (?:\r)?\n
Into: Lyrics
RegExp1: checked
Replace with: vbCrLf
VBScript: checked
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

v5.x Preset: Assign merged Comment from all tracks on Album to <Into Field>...
Description: If Separator is "; ", track#1 has Comment="String1", track#2 has Comment="String2" and track#3 has Comment="String3" -> destination field for all tracks="String1; String2; String3"
Find what: ^.*
RegExp1: checked
Replace with: SQLQuery("SELECT group_concat(F1, '<String Caption="Separator" Value="; " ID=1>') FROM (SELECT DISTINCT Comment AS F1 FROM Songs AS S1 WHERE IDAlbum = " & oSongData.Album.ID & " AND Comment <> '' AND InStr('<ID:1>' || (SELECT group_concat(F2, '<ID:1>') FROM (SELECT DISTINCT Comment AS F2 FROM Songs AS S2 WHERE IDAlbum = " & oSongData.Album.ID & " AND Comment <> '' AND S1.ID <> S2.ID)) || '<ID:1>', '<ID:1>' || Comment || '<ID:1>') = 0 ORDER BY CAST(DiscNumber AS int), CAST(TrackNumber AS int))")
VBScript: checked
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
davidbspalding
Posts: 222
Joined: Fri Jan 08, 2010 3:53 pm
Location: Durham, NC

Transpose values between files, but in sequence...

Post by davidbspalding »

Not sure this can be automated in MM or with this plug-in, but I thought I'd try asking.

I'm recreating new rips of old CDs in FLAC, where previously I had MP3s. The MP3s had individual tags in files, e.g. COMPOSER strings that varied from one file to another in single ALBUMS, e.g. compilations or collaborative works.

Problem? I don't want to copy and paste from each track's file to the track's new file, one by one. I'd like to transpose the COMPOSER tag from track 1 (mp3) to track 1 (FLAC), the COMPOSER tag from track 2 to track 2, etc. Anyway this can be done within MM?

Image

Postscript: Oh I found a slightly faster workaround.

1. Select tracks with the same COMPOSER tag.
2. Select tracks with NO composer tag that you want populated.
3. SHIFT + ENTER or right-click and select properties.
4. Select the checkbox next to COMPOSER field; save/enter.
5. The COMPOSER tag is synced to the files that had empty composer fields.

Still a manual process, though. Doesn't scale if you're managing 100+ files.
«Tell me and I'll forget; show me and I may remember; involve me and I'll understand.» Chinese proverb
T43 XP-SP3 2GB RAM, dual hard drives, MM 4.0.3 Gold; Ipod Classic 7G v2.0.4, Nano 3G v1.1.3.
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

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

Post by ZvezdanD »

You could try Track Redirection & Synchronization add-on if you have the same folder structure between FLACs and MP3s or the same Artists and Titles:
- open Tools | Track Redirection | Options dialog box;
- set fields/tags which you want to synchronize;
- click OK to confirm new settings;
- choose Tools | Track Redirection | Create Redirections/Copy Metadata option;
- choose Duplicates if you have FLAC/MP3 tracks with the same Artists and Titles or choose Folders if they have the same folder structure;
- if you tick Folders on, then set the base folder of MP3 files in the Master text box and the base folder of FLAC files in the Copy text box;
- check on tracks that you want to synchronize in the track list (they are all checked on by default);
- click the Synchronize button.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
kluv
Posts: 30
Joined: Mon Oct 15, 2012 3:24 am

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

Post by kluv »

Hi all, hope you are doing well.

Is there a preset or way to switch Album name from Hear that first MM-DD-YY to Hear that first YY-MM-DD?

Thank you for whatever help you can provide.
MMFrLife
Posts: 2894
Joined: Fri Oct 26, 2012 9:04 pm
Location: MM Forum

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

Post by MMFrLife »

After glancing over a few presets, It seems to be possible but not easy.
You'll need the donate/expanded version and you'd have to batch together around 5 presets.
MM user since 2003 (lifetime lic. 2012) "Trying to imagine life without music gives me a headache"
Top 2 scripts: RegExp Find & Replace (e.v.) and Magic Nodes (e.v.) ZvezdanD's scripts site
Please take a moment to read the bottom of the linked page to support the one and only - ZvezdanD! (the "originator" since 2006).
MMW 4.1.31.1919; 5.0.4.2690 || back it up...frequently!
|| software for power users: "Q-Dir" (free alt. to explorer) and file/folder renamer: "ReNamer" (den4b)
"The absurd is the essential concept and the first truth"
😜
kluv
Posts: 30
Joined: Mon Oct 15, 2012 3:24 am

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

Post by kluv »

Thanks for getting back with me MMFrLife. I do have the expanded version so if you would list the 5 presets I need I can start putting them together.

Thanks again.
Post Reply