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 »

You should be able to do that directly in MM.
Select all album tracks > right-click > properties > erase artist field > type in America.

Is that what you tried?
Similar "idea" for RegEx as above, but it shouldn't be necessary. It can be done as a native function.

As far as a script to just automatically do this every time, not sure, as that field's info would be unique for every album.
There is a way to lop off things at the end in RegEx. but how you would set it for the various unique lengths might be difficult.
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 »

Preset: Keep only specified number of words from the end of <Into Field>...
Description: If specified value = 2, Dark Side of the Moon Pink Floyd -> Pink Floyd
Find what: .*((?:\s+\S+){<Number Caption = "Number of words" Value = "2" MaxValue="100">}$)
Into: whatever field
Regular expression 1: checked
Replace with: LTrim("$1")
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 »

Preset: Remove <From Field> from the begin of <Into Field>
Description: If Album = The Wall, Artist = The Wall Pink Floyd -> Pink Floyd
Find what: ^.*
Into: whatever field (e.g. Artist)
Regular expression 1: checked
Replace with: IIf(<From Field> = Left("$&", Len(<From Field>)), LTrim(Mid("$&", Len(<From Field>) + 1)), "$&")
From: whatever field (e.g. Album)
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
Baalz

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

Post by Baalz »

Hi!
Was looking for help with an expression to insert a "- " in a specific spot in a title
This would be within title field only and be inserted just before "01" in the following ex. "nameoftitle 01 of 13"
So I would end up with "nameoftitle - 01 of 13"
Thanks for any help
Bob
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 »

I want to add the track number to the end of a field. Is there a preset for this I'm blind to,
or is there a way to modify this one:

"Add Track number to the begin of Title"
I can change it to the field I want, but I don't know if there is a way (or how) to get it to the end.

.....or is there another existing preset more suitable for modification for the same purpose?

This is needed for something I do with multi-disc albums/sets.

[note: this seems related to what the previous poster is asking (something like specified string: "-" with auto-increment
to end of title (as a poss. 2nd step) and then as a 2nd or 3rd step add specified string: "of 13", maybe?]
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"
😜
Zaphod703
Posts: 6
Joined: Tue Oct 29, 2013 7:15 pm

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

Post by Zaphod703 »

Hey! Damn I Love This Program! I used to use Mediamonkey for music and now use it for organzing Audiobooks. RegExp still doing an amazing job!! I have list of all the presets in a doc in ABC order. But damn I wish I understood all the coding to create my own preset.

I tried my best to find something and really sorry if it is already possible. Basically I want to Move Text Inbetween something. Example If I use { & } in Artist category for information. And say I want to asign it to a field... or (better if possible) move it before "(" also used in field... move "{<content>}" to come before "(<contents>)". Not sure if that last one is possible? lol this stuff confuses me hahaha. Right now I can move Artist to Custom 1.... Remove everything before { and everything after }. And than move it back. Bit of work. Wondering if there is any easier way.

Sum it up:
I have Many Fields like:
"Name of Series" "(Book #)" "Book Name" "{Descriptions}" "(Year)"

Half I want to... Half Im trying to understand RegExp better... Change it to:
"Name of Series" "{Descriptions}" "(Book #)" "Book Name" "(Year)"

AND/OR... Just How to just copy everything that starts with "{" & ends with "}".
Friedrich
Posts: 176
Joined: Sat Mar 01, 2008 3:14 am

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

Post by Friedrich »

Baalz wrote:Hi!
Was looking for help with an expression to insert a "- " in a specific spot in a title
This would be within title field only and be inserted just before "01" in the following ex. "nameoftitle 01 of 13"
So I would end up with "nameoftitle - 01 of 13"
Thanks for any help
Bob
This expression in the "Find what"-Field might do the job:
(?=0[1-9])
MM5 (2606)and MM4 (1919) installed and running well on:
Debian 11 KDE, EndeavourOS KDE (wine 7.4 via playonlinux), Win10 64bit
Zaphod703
Posts: 6
Joined: Tue Oct 29, 2013 7:15 pm

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

Post by Zaphod703 »

I had oooone lil more question lol... I understand if my other question doesn't have an answer... This one might not either. Just curious: Is there any way to grab onto the the Last Track #. So if every album has their own track numbering.. And say one album ends at 56. At the end I want: "(of 56)" Anyway for RegExp get the Last Track # and assign it? could be assign at the end... I can already add at the end "(of" with either RegEx or ExtractFields and Also I can add the ).

Sorry if im asking bit too much!
Guest

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

Post by Guest »

Code: Select all

& SQLQuery("SELECT Max(CAST(TrackNumber AS integer)) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum")
redbeard
Posts: 8
Joined: Sun Mar 23, 2008 4:08 pm

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

Post by redbeard »

I really like this script, but am having difficulty with the "Append weighted average bitrate of album tothe last folder of path" function.
What happens, is it appends [223] even if all of the album's tracks are 320.

I looked closely and the comment says, "Example for VBScript expressions with SQLQuery (This function is somewhat problematic - SQL syntax must be correct because MM doesn't handle SQL errors)

I'm not sure what this means. I was hoping this would be an easy way to append [VBRxxx] to my album folders, with xxx being the album's average bitrate.
My question is, is this script using the bitrate in my tags? If not, what is it using? I don't know how to edit SQL. The code that is in there now is this:

"$1\$2 [" & Int(SQLQuery("SELECT Sum(Bitrate * SongLength) / Sum(SongLength) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum") / 1000) & " kbps]\$3.$4"

Any help is greatly appreciated!
--redbeard
Flanker37
Posts: 6
Joined: Fri Apr 03, 2015 2:36 pm

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

Post by Flanker37 »

Hi i have just found this thread, i have run a search, but the terms are too common for me to proper results

The problem i have, i have about 3000 tracks where the title of the songs have a single space before them. This is messing up my playlist alphabetical order.

will your plugin remove these spaces automatically, and if so, how do i go about doing it?

thanks
kopo

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

Post by kopo »

will (the) plugin remove these spaces automatically, and if so, how do i go about doing it?
Yes it will.

Use preset 65: "Remove leading and trailing spaces from <Into Field>..."

There's a very comprehensive guide to usage in the first post of this thread.
rast

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

Post by rast »

Cool tool thanks.
QQ: how do I remove a quote from a field? It seems I can remove anything/everything but "

thanks
Hdhntr23
Posts: 106
Joined: Tue Nov 27, 2012 10:21 am

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

Post by Hdhntr23 »

Let's say I import a bunch of songs where the track number is in front of the song title.

Is there a preset that allows me to move the numbers from the beginning of the song to the track number field?

Thanks!
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 »

The new version, from what I can tell, hasn't been released yet (unless I'm just blind to it). I know your very busy, but, without having to commit to a specific
date, could you give us a ballpark ETA like "within 6 months" or "within a year"?
Thanks
Last edited by MMFrLife on Sun Apr 26, 2015 10:17 am, edited 1 time in total.
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"
😜
Post Reply