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

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 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+]

by ZvezdanD » Sun Dec 20, 2020 1:20 am

If you have any constructive suggestion how the user interface could be improved to be easier and more intuitive, but keeping the same level of flexibility and functionality, I will definitely consider it. It is easy to criticize someone's hard work, being creative is much harder.

The tutorial for the add-on could be found in the Usage section on the very same web page from which you downloaded the add-on. You could get that page loaded in your default web browser if you click the version number of the add-on displayed in the top-right corner of its Options dialog box.

Re: Merge 2 Tags for Songs

by Boobounder » Tue Dec 15, 2020 5:04 pm

Ooooooh. Don't say that.

I just spent an hour trying to figure out the interface of that script, and I got nowhere. And I use things like that all the time, and I'm pretty good with regex.

Is there a tutorial out there somewhere?

Re: Merge 2 Tags for Songs

by Lowlander » Tue Dec 15, 2020 4:39 pm

RegExp should be able to do this: viewtopic.php?f=2&t=28510&hilit=regexp

Merge 2 Tags for Songs

by Boobounder » Tue Dec 15, 2020 4:33 pm

Can't believe I can't figure this out or find a simple script ...

How do I prepend the disc # on to the track #?

For example, I have a bunch of songs with disc # set to 2, and track #'s running 01, 02, 03 ...

I want to keep the disc # tag as is, and change the track # tags to 201, 202, 203 ...

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

by cokehearth » Thu Dec 10, 2020 11:11 am

ZvezdanD wrote: Fri Dec 04, 2020 3:57 pm
cokehearth wrote: Fri Dec 04, 2020 4:53 am Is there a way to alphabetise the artists field?
Maybe you could try this:

Code: Select all

SQLQuery("SELECT group_concat(AA, '; ') FROM (SELECT DISTINCT Artists.Artist AS AA FROM Songs INNER JOIN ArtistsSongs ON Songs.ID = ArtistsSongs.IDSong AND (ArtistsSongs.PersonType = 1 OR ArtistsSongs.PersonType IS NULL) INNER JOIN Artists ON ArtistsSongs.IDArtist = Artists.ID WHERE Songs.ID = " & oSongData.ID & ")")
It appears to work! Thank you VERY much for that, you've made my music collection work a lot better.

It really is genuinely appreciated!

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

by ZvezdanD » Fri Dec 04, 2020 3:57 pm

cokehearth wrote: Fri Dec 04, 2020 4:53 am Is there a way to alphabetise the artists field?
Maybe you could try this:

Code: Select all

SQLQuery("SELECT group_concat(AA, '; ') FROM (SELECT DISTINCT Artists.Artist AS AA FROM Songs INNER JOIN ArtistsSongs ON Songs.ID = ArtistsSongs.IDSong AND (ArtistsSongs.PersonType = 1 OR ArtistsSongs.PersonType IS NULL) INNER JOIN Artists ON ArtistsSongs.IDArtist = Artists.ID WHERE Songs.ID = " & oSongData.ID & ")")

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

by cokehearth » Fri Dec 04, 2020 4:53 am

I've been driving myself a little mad trying to figure this out and I can't find anything in the search (perhaps I'm not searching the right thing); so I wonder if those well-versed in this stuff can help me.

Is there a way to alphabetise the artists field? I currently have them stored with ";" separators.

e.g.: "Bomb the Bass; Sinéad O'Connor; Benjamin Zephaniah".

But I would want to be able to alphabetise that field, so it would appear:

"Benjamin Zephaniah; Bomb The Bass; Sineád O'Connor".

The closest I managed to find here was:

Code: Select all

SQLQuery("SELECT group_concat(AA, '; ') FROM (SELECT DISTINCT Artists.Artist AS AA FROM Songs INNER JOIN ArtistsSongs ON Songs.ID = ArtistsSongs.IDSong AND (ArtistsSongs.PersonType = 1 OR ArtistsSongs.PersonType IS NULL) INNER JOIN Artists ON ArtistsSongs.IDArtist = Artists.ID WHERE IDAlbum = " & oSongData.Album.ID & ")")
- But that gets ALL of the artist values for the ENTIRE album the track is on, rather than just that one track on its own and nothing I seem to change will make it just fetch the artists for that ONE song, rather than ALL the artists featured on the album for which the song appears.

Many thanks,
cokehearth

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

by wdp » Mon Nov 23, 2020 4:17 pm

I just don't know how to do that. I have converted the field so I can't show you what it was before I converted it. So I tried to show what is in the iTunes database. I didn't point MM to that database. I pointed it to a copy of that database and it has now been converted using the find and replace addon.

I did not insert the extra line. I inserted an X in one record as I was using the addon. As it didn't yield a good outcome, I didn't do that again. Following your direction, I was able to ascertain that your theory was correct. There is an extra line.

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

by ZvezdanD » Mon Nov 23, 2020 4:00 pm

wdp wrote: Mon Nov 23, 2020 12:45 pm There is nothing to paste but there is an extra line.
I told you, I wanted that you copy/paste the Comment field as it was "before applying the preset" when it still "contained iTunes info". I wanted the original sample to see how it looks like and to try to reproduce the problem with it, but I cannot do that with what you got as the result of the preset. You confused me with that "0x" thing and an extra empty line on the beginning of the Comment, when in fact it was you who added that to the existing iTunes info. Anyway, I am glad that you don't have issues any more.

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

by wdp » Mon Nov 23, 2020 12:45 pm

ZvezdanD wrote: Mon Nov 23, 2020 1:40 am
When I said copy/paste the Comment field, I meant that you open the problematic tracks (that cause the "|") in the Properties dialog in MediaMonkey, copy the Comment field as text and paste it here in the post.

Did you notice an empty line on the beginning of the Comment field in tracks that result having the "|" after applying the preset? Could you try the next preset on such tracks:

Code: Select all

[\s\n]*(0x)?(([0-9A-F]{8} ){3}[0-9A-F]{16}( [0-9A-F]{8}){8}|([0-9A-F]{8} ){9}[0-9A-F]{8})[\s\n]*
Ah. OK. No. The "0x" was my first attempt at using the addon. I was seeing what happened if I had the addon just write an "x" in the comment field. As a matter of fact, if I backspace over the comment field all the way to the top, the "|" vertical line goes away.

There is nothing to paste but there is an extra line. Look at the screen shot. You can see where the cursor is.

EDIT: Well it looks like I have clear my Database and reimport to get the iTunes data/tags. I am missing about half of them. So.... I cleaned the comment field in iTunes. When I re-import it should no longer be an issue.

https://ibb.co/fq0c0Tc

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

by ZvezdanD » Mon Nov 23, 2020 1:40 am

wdp wrote: Sun Nov 22, 2020 9:32 pm Here are the first 3 from the screenshot you reference. That screen shot are from the MM database. These are from the iTunes database using iTunes to screen shot:
The screenshot from iTunes is not referent, because its Comment field could differ from the MM Comment field. The first screenshot made in MM shows "0x" on the beginning of the string, while the tracks in iTunes don't have it. Do all your tracks having the iTunes info contain the "0x" in MM on the beginning?

When I said copy/paste the Comment field, I meant that you open the problematic tracks (that cause the "|") in the Properties dialog in MediaMonkey, copy the Comment field as text and paste it here in the post.

Did you notice an empty line on the beginning of the Comment field in tracks that result having the "|" after applying the preset? Could you try the next preset on such tracks:

Code: Select all

[\s\n]*(0x)?(([0-9A-F]{8} ){3}[0-9A-F]{16}( [0-9A-F]{8}){8}|([0-9A-F]{8} ){9}[0-9A-F]{8})[\s\n]*

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

by wdp » Sun Nov 22, 2020 9:32 pm

ZvezdanD wrote: Sun Nov 22, 2020 1:50 pm Yes, you can. It is visible as Hex characters in the Comment field on your first screenshot. I suppose that you got that "|" thing with tracks having an empty line before ITUNNORM and/or ITUNSMPB tag in the Comment, but I cannot be sure until I see the original content of your Comment field. Please post any source sample of the Comment that results with the "|", so that I could improve the preset.
Here are the first 3 from the screenshot you reference. That screen shot are from the MM database. These are from the iTunes database using iTunes to screen shot:

https://ibb.co/phBS2YG
https://ibb.co/m0jR8Zs
https://ibb.co/dBp1jZW

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

by ZvezdanD » Sun Nov 22, 2020 1:50 pm

wdp wrote: Sun Nov 22, 2020 9:11 am I can't see the iTunes info before apply this preset.
Yes, you can. It is visible as Hex characters in the Comment field on your first screenshot. I suppose that you got that "|" thing with tracks having an empty line before ITUNNORM and/or ITUNSMPB tag in the Comment, but I cannot be sure until I see the original content of your Comment field. Please post any source sample of the Comment that results with the "|", so that I could improve the preset.

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

by wdp » Sun Nov 22, 2020 9:11 am

ZvezdanD wrote: Sat Nov 21, 2020 1:29 am Did you notice anything strange in the table of the Preset Settings dialog with such files before applying the preset? Could you post the Comment field of such tracks with the iTunes info before applying this preset, so that I can observe the pattern between them?
I did not notice anything strange in the preset. I can't see the iTunes info before apply this preset. I think we have done as good as we can and it cleaned up a lot. Apparently these were Hex characters used by iTunes. I don't know what the "|" is. It is weird that is shows when viewed as a list but doesn't show when the song is edited. And it is weird that it is a different color. Thanks for the help.

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

by ZvezdanD » Sat Nov 21, 2020 1:29 am

wdp wrote: Fri Nov 20, 2020 9:48 pm That cleaned up most of it. However, in many fields I have a "|" character left in the comment field.
Did you notice any rule with which comments in tracks you got this "|" character? Did you notice anything strange in the table of the Preset Settings dialog with such files before applying the preset? Could you post the Comment field of such tracks with the iTunes info before applying this preset, so that I can observe the pattern between them?

Top