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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

ZvezdanD
Posts: 3090
Joined: Thu Jun 08, 2006 7:40 pm

Post by ZvezdanD » Fri Apr 25, 2008 9:31 am

Davo wrote:I just noticed when i selected a Title field that in the "before" & "after" area it displays ampersands as underscores.
Yeah, there is a problem with a label control and ampersand. Anyway, in the next version of the script label control will be replaced and this bug resolved.

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous » Fri Apr 25, 2008 5:17 pm

Great script - it would also be cool to add ability to save custom settings, then retrieve again. Perhaps pre-populate with the examples you gave in your first post.

ZvezdanD
Posts: 3090
Joined: Thu Jun 08, 2006 7:40 pm

Post by ZvezdanD » Sat Apr 26, 2008 2:22 am

onenonymous wrote:it would also be cool to add ability to save custom settings, then retrieve again.
It is already under construction :)

Friedrich
Posts: 121
Joined: Sat Mar 01, 2008 3:14 am

Thanks!

Post by Friedrich » Tue May 06, 2008 11:22 am

Many, many thanks, for the script and the helpful & detailed description of its functions, ZvezdanD!!

For sure, that will prove as an extremely useful script for many and came just at the right time for me , as I am just starting to give some more order to a rather large collection. (At the moment I am working on giving uniform titles for different interpretations of the same pieces of (mostly classical) music and your script already saved me hours of editing track by track.)

If I may add a question to my laudatio:
Is there an expression that allows to increase a numerical value inside a string over several selected items? Somewhat similar to the "Auto-increment Track #s" script?

Best wishes!
fritz

P.S.: It may sound somewhat pathetic, but for me it's a wonder and source of great happiness what the commitment and ingenuity of the MM-developers and all the capable community members accomplish here... .

ZvezdanD
Posts: 3090
Joined: Thu Jun 08, 2006 7:40 pm

Re: Thanks!

Post by ZvezdanD » Tue May 06, 2008 2:22 pm

Friedrich wrote:Is there an expression that allows to increase a numerical value inside a string over several selected items? Somewhat similar to the "Auto-increment Track #s" script?
Sorry, regular expressions are mainly used to find and replace parts of string, but not for such complex transformations as you wish. Some of RegExp implementations (Perl,...) have a support for case changing functions, something like Upper and Lower in SQLite. Unfortunately, in VB scripts even those RegExp functions are not supported. I have a plan to implement them for the next version of this script, but I couldn't give any promise about that.

However, maybe you could do this what you want in several iterations, but I am not sure because I don't know exactly what is your intention. For example, if you want to change just one number with only one digit, you could write something like this:

Find what: (\D)7\b
use RegExp1: Yes
Replace with: $18

This will replace all "7" which is not preceded by some digit to "8". So, with this you could replace CD7 to CD8, but not CD7x to CD8x nor CD17 to CD18. For other numbers ("1" to "2", "2" to "3",....) you should modify this example. There are also other similar possibilities, but you should be more specific.
for me it's a wonder and source of great happiness what the commitment and ingenuity of the MM-developers and all the capable community members accomplish here... .
Glad you like all of this what we do. Maybe you should post this message as a new thread, so other scripters who are not visiting this thread could see your opinion about their works. :)

Friedrich
Posts: 121
Joined: Sat Mar 01, 2008 3:14 am

Post by Friedrich » Tue May 06, 2008 5:05 pm

What I meant was the following:
Lets say I have 5 tracks from the Suite No. 1 in D minor, BWV 812 with titles as follows:

Allemande
Courante
Sarabande
Menuet I/II
Gigue

I like them to have the following form instead:

Suite No. 1 in D minor, BWV 812, 1. Allemande
Suite No. 1 in D minor, BWV 812, 2. Courante
Suite No. 1 in D minor, BWV 812, 3. Sarabande
Suite No. 1 in D minor, BWV 812, 4. Menuet I/II
Suite No. 1 in D minor, BWV 812, 5. Gigue

So for the most important part of the job your script comes in very handily (always missed a function like that...):
Adding the string "Suite No. 1 in D minor, BWV 812, " into the title!

Adding increasing numbers (from 1. to 5.) is obviously not what regular expressions, -thanks again for your kind explanation...-, are made for and require a kind of algorithm like the one in the "AutoIncTrackN.vbs":

Code: Select all

if Form.ShowModal=1 then
    number = SE.Value
    ' Process all selected tracks
    For i=0 To list.count-1
      Set itm = list.Item(i)
      ' Swap the fields
      itm.TrackOrder = number
      number = number + 1
    Next
    list.UpdateAll
  End If
Even if it were possible to realize somehow it would probably be a waste of time to try to provide such a rarely needed function.

I will live happily without it... :)

Best regards!
fritz

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Tue May 06, 2008 5:44 pm

perhaps its possible to add a custom increment() to allow for such with RegEx.

or perhaps even more simply, allowing the use of the selection # to be applied to the field...

ie

in the dialog it shows selection #/Total Selection (inbetween the > and find next button), if you could select the tracks you want and apply that selection position number to the field for each of the tracks selected.

ZvezdanD
Posts: 3090
Joined: Thu Jun 08, 2006 7:40 pm

Post by ZvezdanD » Tue May 06, 2008 6:04 pm

Friedrich wrote:Lets say I have 5 tracks from the Suite No. 1 in D minor, BWV 812 with titles as follows:
If your track numbers are from 1 to 5 for mentioned tracks, you could do what you want with several steps on same tracks:

I step:
Find with: ^
in: Title
use RegExp1: Yes
Replace with: .
use RegExp2: No

II step:
Find what: ^
in: Title
use RegExp1: Yes
Replace with: .*
in: Track #
use RegExp2: Yes

III step:
Find what: ^
in: Title
use RegExp1: Yes
Replace with: Suite No. 1 in D minor, BWV 812,
use RegExp2: No

As you can see, if you put only "^" in the Find what text box, this means that you want to insert some text in the front of the find in field. If you are interested to insert some text in the end of the find in field you could put "$" in the Find what text box.

Friedrich
Posts: 121
Joined: Sat Mar 01, 2008 3:14 am

Post by Friedrich » Wed May 07, 2008 2:01 am

Thanks for your thoughts, Teknojunky.
Teknojnky wrote:or perhaps even more simply, allowing the use of the selection # to be applied to the field...
ie
in the dialog it shows selection #/Total Selection (inbetween the > and find next button), if you could select the tracks you want and apply that selection position number to the field for each of the tracks selected.
The number (count) of selected tracks would seemingly be the way to go as obviously, -like you pointed out-, the information is already there.
(In the dialog and of course in the code. "oSongList.Count" when I am guessing correctly; sorry, I am an almost complete coding illiterate)

But I guess it would not be that easy to get it implemented in a handy & easy for all to understand way into the dialog window?
Last edited by Friedrich on Wed May 07, 2008 2:45 am, edited 2 times in total.

Friedrich
Posts: 121
Joined: Sat Mar 01, 2008 3:14 am

Post by Friedrich » Wed May 07, 2008 2:27 am

@ZvezdanD
Thanks for your advice. Thats a nice workaround.
Definitely easier and safer than what I used to do until now.
(Using the auto-organize & Auto-tag from filename function back and forth to get the numbers into the title)
At least for complete albums its easy to change the track numbers temporarily with the Auto-increment script to match the desired number patterns, so that the 3 steps you explained above can be applied to the whole album.
---
2 questions concerning the scripts behaviour:

1. The script-window closes when I choose the "Replace all" button.

2. Am I wrong, or does the script not synchronize the tags?

Is it intended to be like this?

Have a nice day!
fritz

ZvezdanD
Posts: 3090
Joined: Thu Jun 08, 2006 7:40 pm

Post by ZvezdanD » Wed May 07, 2008 12:42 pm

Friedrich wrote:At least for complete albums its easy to change the track numbers temporarily with the Auto-increment script to match the desired number patterns, so that the 3 steps you explained above can be applied to the whole album.
I am trying to simplify this for the next version, so that only one step could be used.
1. The script-window closes when I choose the "Replace all" button.
Yes, this is intended to be like that, but I think I'll change that in the next version.
2. Am I wrong, or does the script not synchronize the tags?
Sorry, there was a bug (same as in Magic Nodes). Thanks for the report.

You could take a new release of this script from the first post of this thread.

Friedrich
Posts: 121
Joined: Sat Mar 01, 2008 3:14 am

Post by Friedrich » Thu May 08, 2008 5:52 am

ZvezdanD wrote:I am trying to simplify this for the next version, so that only one step could be used.
Great!
Yes, this is intended to be like that, but I think I'll change that in the next version.
Its a bit unpractical only when doing multiple operations on the same files.
You could take a new release of this script from the first post of this thread.
You bet i will, ...did.
---

One function, among many others, that I find particularly useful:
Moving the content, -completely or parts of it!-, from one field to any position you can imagine of another field!

@all
To those who at first glance might be frightened a bit by the abstract syntax, like I was:
The more you get used to it, the more you will love it!
Get on and do all the things with your tags, you always wanted to do, but were too lazy to do, because they required a heck of a lot of track-by-track-work.... ;-)

Guest

Post by Guest » Sat May 10, 2008 8:52 am

This is just the type of script I was looking for. However, while attempting to install the script (downloaded today - May 9th), I received an error message: "Product Installation error."

I am using the latest version of MM (3.0.2.1134) Gold and Windows Vista.

I also noticed the script was updated two days ago - might this be an issue or am is something wrong on my end?

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex » Sat May 10, 2008 8:55 am

Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts

cupstack
Posts: 3
Joined: Sat May 10, 2008 8:33 am

Post by cupstack » Sat May 10, 2008 8:55 am

sorry - just realized I was not logged in, the previous post is mine (installation error).

Post Reply