Page 52 of 108

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

Posted: Tue Dec 20, 2011 10:29 pm
by lapillus
Thanks for the VERY useful script!

Among the presets I particularly appreciate one that removes the artist from the genre and was wondering what the code would be to do the same for the title and the album. Any help would be appreciated!

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

Posted: Wed Dec 21, 2011 7:15 pm
by ZvezdanD
lapillus wrote:Among the presets I particularly appreciate one that removes the artist from the genre and was wondering what the code would be to do the same for the title and the album.
You should be more specific what exactly you want with some examples of your current title/album. Do you have artist at the begin of the title/album or on the end or in the middle, what is a separator between them...? If you have the album name like "Artist - Album" you could use the "Remove Artist name and " - " or "-" from the begin of <Into Field>..." preset.

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

Posted: Wed Dec 21, 2011 11:31 pm
by lapillus
ZvezdanD wrote:
lapillus wrote:Among the presets I particularly appreciate one that removes the artist from the genre and was wondering what the code would be to do the same for the title and the album.
You should be more specific what exactly you want with some examples of your current title/album. Do you have artist at the begin of the title/album or on the end or in the middle, what is a separator between them...? If you have the album name like "Artist - Album" you could use the "Remove Artist name and " - " or "-" from the begin of <Into Field>..." preset.
Sorry, I meant remove the Artist and the Album that have been added to the list of genres by the GenreFinder Extension. They're just regular genres, no easily spotted punctuation, unfortunately. Some folks on LastFM don't seem to get that you don't need to tag those sorts of things and with a library of about 20,000 titles weeding them out is proving to be a huge pain.

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

Posted: Thu Dec 22, 2011 3:25 am
by ZvezdanD
lapillus wrote:I meant remove the Artist and the Album that have been added to the list of genres by the GenreFinder Extension.
Again, you are not giving any examples. I cannot write the preset if I don't know how exactly looks your Genre and Album tag.

Anyway, maybe you could try the next two presets:
Preset: Remove <From Field> item from multi-item <Into Field>...
Description: The Beatles (Artist) and Rock; The Beatles; Pop/Rock (Genre) -> Rock; Pop/Rock (Genre)
Find what: ^.+
Into: whatever, e.g. Genre
Regular expression 1: checked
Replace with: IIf(Len(<From Field>) > 0, LTrim(Mid(RegSub(";$&", ";\s?(" & RegSub(RegSub(<From Field>, "([^;\w])", "\$1"), ";\s?", "|") & ")", ""), 2)), "$&")
From (<<): whatever, e.g. Album
VBScript expression: checked

Preset: Clear <Into Field> if it is equal to <From Field>...
Description: The Beatles (Artist) and The Beatles (Genre) -> (empty Genre)
Find what: ^.+
Into: whatever, e.g. Genre
Regular expression 1: checked
Replace with: IIf(Len(<From Field>) > 0 And <From Field> = "$&","", "$&")
From (<<): whatever, e.g. Album
VBScript expression: checked

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

Posted: Thu Dec 22, 2011 5:16 pm
by AshwinP
Hi,

Need some help... I did a search on my library for a string that got 2 tracks in the resut. however when I tried to to a find and replace using this tool, I am not able to find that string in any of the tags... I tried searching in individual tag fields and also in All Test fields, but couldn't find the string any where...

How is it then that the MM search feature is able to find tracks with a string, but the same is not found when using this tool...

regards,
Ashwin.

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

Posted: Thu Dec 22, 2011 5:45 pm
by ZvezdanD
AshwinP wrote:How is it then that the MM search feature is able to find tracks with a string, but the same is not found when using this tool...
- What is your version of the program and this add-on?
- Did you select all tracks from the Library before you entered the RegExp Find & Replace dialog box?
- What is your settings in the mentioned dialog box? Could you post its screenshot?
- What is your string that you are looking for?
- Did you have selected the field which contains that string in the Options dialog box > Library/Search sheet (relevant only if you choose All Text Fields)?

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

Posted: Fri Dec 23, 2011 5:34 pm
by AshwinP
Hi,

Thanks for the quick response...
- What is your version of the program and this add-on?
- Did you select all tracks from the Library before you entered the RegExp Find & Replace dialog box?
- What is your settings in the mentioned dialog box? Could you post its screenshot?
- What is your string that you are looking for?
- Did you have selected the field which contains that string in the Options dialog box > Library/Search sheet (relevant only if you choose All Text Fields)?
I am using the latest versions of both MM and the regEx tool
Yes, I did select all the tracks
Did not get the last question, where can I find this option?
The string I am looking for is http://www.songs.pk
Here's the screen shot for more details...
http://www.freeimagehosting.net/f9a00

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

Posted: Fri Dec 23, 2011 6:36 pm
by ZvezdanD
AshwinP wrote:
- Did you have selected the field which contains that string in the Options dialog box > Library/Search sheet (relevant only if you choose All Text Fields)?
Did not get the last question, where can I find this option?
Options dialog box > Library/Search sheet.

I cannot see from the screenshot that any field contains the mentioned string. Are you absolutely sure that the selected tracks contain it? Maybe your search result in the program is wrong.

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

Posted: Fri Dec 23, 2011 6:42 pm
by AshwinP
Well, you must have noticed in the screen shot the search string is exactly the same... I am looking to seach for www.songs.pk first in the main library, then I am trying to remove it for all the selected tracks.

Funny thing is that, I am also not able to find it any of the properties/tags. So, question is if the string really isnt there, then why is MM search showing me the results...?

If there is a way I can send you a track and you can try it for yourself.

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

Posted: Fri Dec 23, 2011 6:51 pm
by ZvezdanD
AshwinP wrote:So, question is if the string really isnt there, then why is MM search showing me the results...?
Maybe MM search function has a bug?
AshwinP wrote:If there is a way I can send you a track and you can try it for yourself.
You could upload it to some file server like Mediafire and post me the link using PM.

EDIT: Maybe you could try to enclose the mentioned string inside of double quotes when using MM search option (http://www.mediamonkey.com/wiki/index.p ... Search/4.0).

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

Posted: Fri Dec 23, 2011 7:07 pm
by AshwinP
Ok, just found out that there are some fields like 'Comments' and 'Subtitle' that are missing in MM, I noticed that these are filled with the String I am looking for... but again, the question is if these fields are omitted in MM, why is a search on the track in MM showing results (Bug???)... Must have to do something with the ID3 tag versions I guess, but I am no expert on it.

Can these 2 fields also be added as Text fields to the ReqEx tool??? That should resolve part of the problem.

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

Posted: Fri Dec 23, 2011 7:22 pm
by ZvezdanD
AshwinP wrote:the question is if these fields are omitted in MM, why is a search on the track in MM showing results (Bug???)...
Well, if you don't have those fields selected in the Options dialog box, but MM is still finding the mentioned string in those fields, then it is a MM bug.
AshwinP wrote:Can these 2 fields also be added as Text fields to the ReqEx tool???
I told you already: open the Options dialog box > Library/Search sheet and select fields that you want to search for using All Text Fields. Or just specify Comment in the Into list of the RegExp dialog. The Subtitle is not available for searching using this add-on, but neither with the MM search option. BTW, try also my previous suggestion with double quotes when using MM search option.

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

Posted: Sat Jan 07, 2012 9:54 pm
by Beggar
Thanks ZvezdanD. It a late thank you, but THANKS, really appreciate it. Manage to get the script to work. But I got another request that need your help. Below is what I asked, and what you told me to use;

Code: Select all

Find what: ^.*
Into: Album Artist
Regular expression 1: checked
Replace with: 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 & ")")
VBScript expression: checked
Question: Is it possible to Copy all Artist of the track then add them (cumulative) to Album Artist?

I hate having Album Artist as "Various Artist"
So I tend to copy the Artist of each track, listing them in order from Track 1>Infinity. So to further expand the question, is that possible?

For example:
Track: 1, Artist: A, Album Artist: A
Track: 2, Artist: B, Album Artist: A
Track: 3, Artist: C, Album Artist: A
(RegExp Find & Replace)
Track: 1, Artist: A, Album Artist: A;B;C
Track: 2, Artist: B, Album Artist: A;B;C
Track: 3, Artist: C, Album Artist: A;B;C

What I want to ask for is, it is possible to have it not in Alphabetic order but in order of 'Appearance'?
E.g.
Track 1 - Artist B
Track 2 - Artist A
Track 3 - Artist C
(RegExp Find & Replace)
Track: 1, Artist: A, Album Artist: B;A;C
Track: 2, Artist: B, Album Artist: B;A;C
Track: 3, Artist: C, Album Artist: B;A;C

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

Posted: Sun Jan 08, 2012 5:00 am
by ZvezdanD
Beggar wrote:What I want to ask for is, it is possible to have it not in Alphabetic order but in order of 'Appearance'?
I don't know what you mean by "Appearance". If you want to get artists ordered by Track #, then you could use this Replace with string:

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 & " ORDER BY CAST(Songs.TrackNumber AS int))")
If you want to get them sorted by adding order then replace CAST(Songs.TrackNumber AS int) with Songs.ID or Songs.DateAdded. Although, I don't understand why you need such format when alphabetic order is more natural.

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

Posted: Sun Jan 08, 2012 1:37 pm
by lobojon
Switching from Extract Fields because of upgrade to MM4. I have no choice apparently.

So, now I have to learn how to use this powerful script. No worries, but oh so short term depressing for me.

I have the bunch of files with the following information in ONE field : 02 artist name ¤ song title.

I need to extract the track# to the proper field and eliminate the leading 0
I need to replace the ¤ character with a "-" so that I can...
Split artist and title into their respective fields

I used to use a combo of the MM Ctrl T/Q functions, Mp3tag, and the Extract Fields script and then the Leading 0s script to solve this problem. Perhaps it was not so efficient, but it worked for me. Of course, I am a complete noob and winging it while using these scripts and program functions. However, I am still able to solve most of my problems

I am trying to discover the process in RegExp Find and Replace in order to accomplish the above task. Can anyone help me find the topic/thread/instructions/etc to understand and perform this operation? I continue to troll the forum as usual since I am not the first person to encounter this paradigm shift from MM3 to MM4 and a limited skill set.

Willing and able to be retrained.