RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Hopefully someone can give me a hand with this - I'm trying make a script that swaps A and B but only if B exists (ie B is not empty).
Swapping A and B is a preset but I'll be if I understand Reg expressions and where to put the "if B exists" part!
Can anyone give me a pointer please?
Swapping A and B is a preset but I'll be if I understand Reg expressions and where to put the "if B exists" part!
Can anyone give me a pointer please?
-
- Posts: 1189
- Joined: Tue Jun 13, 2017 8:47 am
- Location: Vienna
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
' A simple script that swaps the content of Title and Artist fields of selected tracks
' DEMO
' DEMO
Code: Select all
Set list = SDB.SelectedSongList
if list.count<1 then exit sub
For i=0 To list.count-1
Set itm = list.Item(i)
A = itm.Title
B = itm.ArtistName
if B<>"" then 'String is Not Null And Not Empty
itm.Title = B
itm.ArtistName = A
end if
Next
list.UpdateAll
MMW 4.1.31.1919 Gold-Standardinstallation
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
champion! thanksErwin Hanzl wrote: ↑Wed May 29, 2019 12:44 pm ' A simple script that swaps the content of Title and Artist fields of selected tracks
' DEMO
Code: Select all
Set list = SDB.SelectedSongList if list.count<1 then exit sub For i=0 To list.count-1 Set itm = list.Item(i) A = itm.Title B = itm.ArtistName if B<>"" then 'String is Not Null And Not Empty itm.Title = B itm.ArtistName = A end if Next list.UpdateAll
-
- Posts: 65
- Joined: Thu Aug 24, 2017 6:13 am
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
I'm driving myself mad trying to figure this one out.
I'm trying to set "Custom 4" field to display the TOTAL number of tracks for an entire album - and not just on the one disc.
E.g.
If Disc 1 has 10 tracks, and Disc 2 has 15, I would want to Custom 4 to display "25".
Is there any way to display this?
And optionally, to make the number be at least four numbers long? (e.g. 0025 instead of 25)?
Many thanks.
UPDATE:
I figured out getting the total number of tracks:
SQLQuery("SELECT Count(CAST(TrackNumber AS integer)) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum")
All I need now is to find out how I ensure the result comes out as a four-figure number?
I'm trying to set "Custom 4" field to display the TOTAL number of tracks for an entire album - and not just on the one disc.
E.g.
If Disc 1 has 10 tracks, and Disc 2 has 15, I would want to Custom 4 to display "25".
Is there any way to display this?
And optionally, to make the number be at least four numbers long? (e.g. 0025 instead of 25)?
Many thanks.
UPDATE:
I figured out getting the total number of tracks:
SQLQuery("SELECT Count(CAST(TrackNumber AS integer)) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum")
All I need now is to find out how I ensure the result comes out as a four-figure number?
Primarily using: MM4 (latest update) Gold on Windows 11 (32GB RAM);
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
-
- Posts: 1189
- Joined: Tue Jun 13, 2017 8:47 am
- Location: Vienna
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
strgVar=right(10000+ResultFromSQL,4)
MMW 4.1.31.1919 Gold-Standardinstallation
-
- Posts: 65
- Joined: Thu Aug 24, 2017 6:13 am
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Works beautifully!
Many thanks, Erwin!!
Primarily using: MM4 (latest update) Gold on Windows 11 (32GB RAM);
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
-
- Posts: 1189
- Joined: Tue Jun 13, 2017 8:47 am
- Location: Vienna
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Bingo
Thanks for the feedback.
It is always nice to know if suggestions could be implemented
You could also try to build your SQL query instead of "ResultFromSQL"
Thanks for the feedback.
It is always nice to know if suggestions could be implemented
You could also try to build your SQL query instead of "ResultFromSQL"
MMW 4.1.31.1919 Gold-Standardinstallation
-
- Posts: 65
- Joined: Thu Aug 24, 2017 6:13 am
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Excuse me if this has been asked before, but I couldn't find an answer thus far.
Is it possible to use this add-on to have multiple fields copied to a single field?
For example:
Year -> Genre, Album Artist -> Genre, Grouping -> Genre
So that the resulting Genre field would display:
2000; Madonna; Album
(which is <Year>; <Album Artist>; <Grouping>)
Many thanks.
Is it possible to use this add-on to have multiple fields copied to a single field?
For example:
Year -> Genre, Album Artist -> Genre, Grouping -> Genre
So that the resulting Genre field would display:
2000; Madonna; Album
(which is <Year>; <Album Artist>; <Grouping>)
Many thanks.
Primarily using: MM4 (latest update) Gold on Windows 11 (32GB RAM);
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
-
- Posts: 1189
- Joined: Tue Jun 13, 2017 8:47 am
- Location: Vienna
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Code: Select all
Set list = SDB.SelectedSongList
if list.count<1 then exit sub
For i=0 To list.count-1
Set itm = list.Item(i)
itm.Genre=itm.Year & "; " & itm.AlbumArtistName & "; " & itm.AlbumName
Next
list.UpdateAll
MMW 4.1.31.1919 Gold-Standardinstallation
-
- Posts: 65
- Joined: Thu Aug 24, 2017 6:13 am
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
Very much appreciated, thank you!Erwin Hanzl wrote: ↑Wed Jul 24, 2019 11:14 amhttps://www.mediamonkey.com/wiki/index.php/SDBSongDataCode: Select all
Set list = SDB.SelectedSongList if list.count<1 then exit sub For i=0 To list.count-1 Set itm = list.Item(i) itm.Genre=itm.Year & "; " & itm.AlbumArtistName & "; " & itm.AlbumName Next list.UpdateAll
Primarily using: MM4 (latest update) Gold on Windows 11 (32GB RAM);
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
Samsung A54G 128GB/1TB MicroSD.
Library: 1875GB (254680+) files, on a Network Drive (Windows)
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
I have upgraded my computer from Windows 7 to Windows 10. Now the RegExp Find & Replace app takes almost a minute (or more) just to load. Does anyone have advice on what to do about this? Perhaps I should re-install the app. If so, where is the most up-to-date version of it? Or is there something else I can do? I know that with the Windows upgrade more memory is required and so other things have slowed on the computer, but only a little bit. This one has become categorically different in terms of slowness since I upgraded. Please advise.
-
- Posts: 1189
- Joined: Tue Jun 13, 2017 8:47 am
- Location: Vienna
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
DOWNLOAD RegExp Find and Replace Version 4.4.9: http://solair.eunet.rs/~zvezdand/RegExpReplace.htm
MMW 4.1.31.1919 Gold-Standardinstallation
Shortening of artist names?
Hi! I'm rather new to both MM and all kind of regex, so sorry for a maybe basic question. I'm trying to shorten names from e.g. Johann Pachelbel to J. Pachelbel. Right now, I first run a preset to insert ". " after the first letter, then I run the preset to remove 1 word after the first word.
Is there a way/preset to do all this at once? Im using the extended version.
Thanks!
Is there a way/preset to do all this at once? Im using the extended version.
Thanks!
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
I had the same problem. What I ended up doing was deleting a bunch of the presets I never used, and it now loads much faster. Not sure if that's an option for you, but just an idea.tm806891 wrote: ↑Sat Aug 03, 2019 5:57 am I have upgraded my computer from Windows 7 to Windows 10. Now the RegExp Find & Replace app takes almost a minute (or more) just to load. Does anyone have advice on what to do about this? Perhaps I should re-install the app. If so, where is the most up-to-date version of it? Or is there something else I can do? I know that with the Windows upgrade more memory is required and so other things have slowed on the computer, but only a little bit. This one has become categorically different in terms of slowness since I upgraded. Please advise.
Re: Shortening of artist names?
The extended version allows you to execute several presets at once using the Batch option. Please read the Usage section of the add-on's web page to learn more about that option.Johan_A_M wrote: ↑Fri Aug 23, 2019 4:38 amI'm trying to shorten names from e.g. Johann Pachelbel to J. Pachelbel. Right now, I first run a preset to insert ". " after the first letter, then I run the preset to remove 1 word after the first word.
Is there a way/preset to do all this at once? Im using the extended version.
● 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