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

elliottdp
Posts: 27
Joined: Tue Mar 22, 2011 1:27 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by elliottdp »

Again, you have "saved" the day. Thank you very much for your help.

As I have said before, it is an awesome add-on. The best and most useful one I have come across.

That and the Swap artist-title script. :)
Rice

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by Rice »

Sorry maybe don't see - where is mmip installer file.thx
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by ZvezdanD »

Rice wrote:Sorry maybe don't see - where is mmip installer file.thx
There is the link in the Download section of the first post which leads to the download page.
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
Guest

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by Guest »

thank you, i found it was my problem my pc save mmip as zip file i think wrong file-association.
one question - i use the toolbar button for swap entrys, is there a way to configure or give me a hint for the programm-region where to find - to avoid message "are you sure..." ?
very powerful program thx for sharing this. Rice
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by ZvezdanD »

Guest wrote:i use the toolbar button for swap entrys, is there a way to configure or give me a hint for the programm-region where to find - to avoid message "are you sure..." ?
Tools > Options > General / RegExp Find and Replace > Confirm execution of the preset selected in the menu or toolbar
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
Rice

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by Rice »

oooh, thx haven't know about this section, that's fine..
TWKArtist

Re: RegExp Find & Replace -- Adding incremented track number

Post by TWKArtist »

Here's what I use to add track numbers.

If I have track titles like this:
ArtistName--FirstTrackName
ArtistName--SecondTrackName
ArtistName--ThirdTrackName

I use custom settings in RegEx like this:

Find What: "--"
Original: "ArtistName--ThirdTrackName"
Replace with: "--"&IIf(Len(oSongData.TrackOrderStr)=1,"0"&oSongData.TrackOrderStr,oSongData.TrackOrderStr)&": "
Replacement: "--03:"
Result: "ArtistName--03: ThirdTrackName

The expression adds a leading zero (which I like to do) if the length of the track order string is only 1 character; if its more than one character is just uses whatever numbers are in the string.

Downside is that it relies on whatever track order is already in the database.
I agree that what is needed is a way to number tracks independently from the track order number -- like if I select four tracks at random and would be able to number them one through four, regardless of what the track order number is.

You could, of course, modify the "Find What" and the "Replace With" strings to to whatever you want. For instance, it has been mentioned elsewhere here that if you use "^" for the Find What parameter, your new string will appear at the very beginning of the new title.

Hope this helps.... :D

>>TimK
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace -- Adding incremented track number

Post by ZvezdanD »

TWKArtist wrote:Downside is that it relies on whatever track order is already in the database.
You could get the ordinal number of selected tracks instead of Track # if you replace oSongData.TrackOrderStr with lSongIndex. Take a look at the "Auto-increment Track number with specified starting value..." and "Add ordinal number of current track to the begin of Title" presets.
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
sperk
Posts: 90
Joined: Wed Oct 11, 2006 1:52 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by sperk »

Hi,
I'm way in over my head with this script, completely clueless. If I have a title like:
2 - Yesterday - Beetles and I want to replace the "2" with the track no. how can I do that?
If you can, break it down for an idiot, like what box I enter info into.
thanks
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by ZvezdanD »

sperk wrote:If I have a title like:
2 - Yesterday - Beetles and I want to replace the "2" with the track no. how can I do that?
Find what: ^\d+(?= - )
Into: Title
Regular expression 1: checked
Replace with: oSongData.TrackOrderStr
VBScript expression: 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
sperk
Posts: 90
Joined: Wed Oct 11, 2006 1:52 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by sperk »

thank you very much! This is a very powerful script.
aprzybylo
Posts: 301
Joined: Tue Aug 21, 2007 2:58 pm
Location: Ottawa, Canada
Contact:

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by aprzybylo »

Hello, I have very specific update to do. My custom field looks like
XX-AAAA
where XX is 2 digit number and AAAA is any lenght string
After I run update I want my 2 digit number to increment and a character to add to the string, so example

14-ABCD I would like to update to 15-ABCDX

Any idea if this can be done with that script?

Thank you
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Post by ZvezdanD »

aprzybylo wrote:After I run update I want my 2 digit number to increment and a character to add to the string
Find what: ^.*
Into: Custom 1
Regular expression 1: checked
Replace with: Right("0" & Int(Left("$&", 2)) + 1, 2) & Mid("$&", 3) & "X"
VBScript expression: 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
Don
Posts: 6
Joined: Thu May 08, 2008 7:09 pm

RegExp Find & Replace to clear unwanted ASCII char

Post by Don »

This is a summary of messages that may be of interest on the Forum

From Don to ZvezdanD:

I like and use “RegExp Find & Replace” but I am totally dumb when it comes to Regular Expressions.
How could I remove <tab>, <CR>, <LF> and any other such characters – i.e. Decimal characters 0-30 from a MediaMonkey tag field. They are sometimes pasted into fields by mistake and can prevent matching when “Auto-organize files” is used.

From ZvezdanD to Don:

You could try:
Find what: [\x00-\x1E]
Regular expression 1: checked
Replace with: leave empty
Explanation...
If you click on the bottom left "?" button in the RegExp Find and Replace dialog box you will see a short reference for regular expressions. The [...] represents a set of characters for which you want to search. A range of characters could be specified using xx-yy notation - the \xYY represents hexadecimal ASCII code of the character. So, if you want to find decimal 9 you should write [\x09-\x09] or [\x09] or just \x09 since you are searching for only one character.
Don
Posts: 6
Joined: Thu May 08, 2008 7:09 pm

RegExp Find & Replace to precede Track-name with Composer

Post by Don »

This is a summary of messages that may be of interest on the Forum

From Don to ZvezdanD:
Explanation...
I have “Composer” entered for most tracks, in the form: Last_Name + “, ”+Initials
I have maintained this format so the Last_Name would be from the start of the Composer-field to the first comma.

Some of my Track-Names already contain the last-name of the composer.

What I would like to do is...
In the selection, if the Composer-field is not empty, then for those Track-Names that do NOT contain the Last-Name of the composer I want to PRECEDE the Track-Name with the contents of the Composer-field + “ - ” (i.e. space dash space)

E.G.
If the composer = “Beethoven, Lv” and the track = “String Trio in E flat major Op.3 - Andante”
Then the track becomes: “Beethoven, Lv - String Trio in E flat major Op.3 - Andante”
However do nothing if the composer = “Beethoven, Lv” and the track =
“String Trio in E flat major Op.3 – Andante (Ludwig van Beethoven)”
Or
“Ludwig van Beethoven - String Trio in E flat major Op.3 – Andante”
Or
“Beethoven - String Trio in E flat major Op.3 - Andante”
Etc.

From ZvezdanD to Don:
(1)
A simple approach would be to modify an existing PreSet and filter the required records by eye...
i.e. A PreSet that copies the contents of one field (say Composer) to the beginning of another (say Track-name) with a joining " - " (ie space dash space)
You could use the modified "Add Artist name and "" - "" to the begin of <Into Field> (only if exists)..." preset, just replace oSongData.ArtistName with oSongData.Author or whatever you want. If you don't know variable names for corresponding fields, just select the wanted field from the dropdown list at right of the Replace with combo box and click on the << button between them. Here is the simple form:
Replace with: IIf(Len(oSongData.Author) > 0, oSongData.Author & " - ", "") & "$&"

(2)
A preset nearer to your request (which I haven't tested):
Replace with: IIf(Len(oSongData.Author) > 0 And InStr("$&", RegExp(oSongData.Author, ".+(?=,.+)", 0)) = 0, oSongData.Author & " - ", "") & "$&"
As you could see, the only difference is "And InStr("$&", RegExp(oSongData.Author, ".+(?=,.+)", 0)) = 0" which tests if the left part of the Composer field before the "," character is not contained in the specified Into field.


From Don to ZvezdanD:
ZvezdanD, thank you very much.
Cheers, Don
Post Reply