Page 46 of 109

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Posted: Sat Jun 18, 2011 2:38 am
by MM3 monkey
Hello, ZvezdanD.

I've got some tracks that I stupidly tagged like this for a specific reason ages ago. I want to put them right again:

In the Title field I have: song title/artist's name [there are no spaces between the end of the title, the "/", and the beginning of the artist.]
In the Artist field I have: Useless nonsense
In the Album Artist field I have: Useless nonsense

Can I use this script to take the artist out of the Title field and put it into the Artist and also the Album Artist fields, overwriting their current contents. I.e. I need the replace the Artist and Album Artist fields with everything after the "/" in the Title field.

Then I just need to remove the "/" from the end of the Title field.

Many thanks.

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Posted: Sat Jun 18, 2011 3:53 am
by ZvezdanD
MM3 monkey wrote:Can I use this script to take the artist out of the Title field and put it into the Artist
Find what: ^.*
Into: Artist
Regular expression 1: checked
Replace with: IIf(InStr(oSongData.Title, SetVar(0, "<String Caption="Separator" Value="/">")) > 0, Mid(oSongData.Title, InStrRev(oSongData.Title, GetVar(0)) + Len(GetVar(0))), "$&")
VBScript expression: checked
MM3 monkey wrote:and also the Album Artist fields, overwriting their current contents
"Copy <From Field> to <Into Field>" preset, Source = Artist, Destination = Album Artist
MM3 monkey wrote:Then I just need to remove the "/" from the end of the Title field.
"Remove the end of <Into Field> after (and including) specified string" preset, Destination = Title, specified string = /

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Posted: Sat Jun 18, 2011 6:20 am
by MM3 monkey
Thanks, you're amazing.

However, the last part of your walkthrough doesn't seem to work.

I ran the "Remove the end of <Into Field> after (and including) specified string" preset as follows:

Destination field = Title
Trim string after: /

But nothing happened. The title still contains "song title/artist's name"

I'm using MM4.

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Posted: Sat Jun 18, 2011 7:15 am
by ZvezdanD
MM3 monkey wrote:I ran the "Remove the end of <Into Field> after (and including) specified string" preset as follows:

Destination field = Title
Trim string after: /

But nothing happened.
Thanks for the report. You are right, that implementation works only if the specified string is preceded with a space character. You need to modify Find what string in that preset like this:

Code: Select all

\s*<String Caption="Trim string after" Value="/">(.|\s)*$
i.e. instead of \s+ at the begin it should be \s*.

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Posted: Sun Jun 19, 2011 5:51 am
by MM3 monkey
^ Fantastic. And greatly appreciated as ever.

Re: RegExp Find & Replace 4.1 w/ 217 presets (2011-03-03) [M

Posted: Mon Jun 20, 2011 11:23 pm
by kiwichick
"why would you need that field with this add-on"

MM4 will import Music Video files to the Video node unless they have Genre set to Music Video when they're scanned into the Library. They then need to have the Type (or genre) changed to Music Video so they'll appear in the Music Video node instead. I would use an REFR button to batch change the Type. Yes I could use it to change the Genre field but I prefer to use the Type field and leave Genre free for actual genres.

"you could just use Properties dialog box"

Yes but an REFR toolbar button is so much quicker :D

And, as far as I'm concerned, you can call the new field whatever you like and whatever is easiest for you :D :D

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

Posted: Tue Jun 21, 2011 5:29 pm
by ZvezdanD
murraynt wrote:is there an option to select everything at once?
kiwichick wrote:Would it be possible, in a future update, to add a new field to go with MM4's field for the type of media added - music, video, music video, podcast, etc?
There is the new update, v4.2 - 2011-06-21
* Added: All Text Fields item to Into and From dropdown lists which allows assigning the same value to the several fields at once (with MM 3.1 or higher it could be specified which fields you want to modify using settings in the Search sheet of the Options dialog box; please be careful with that option, especially with the specified Path field!);
* Added: possibility to specify <From Field> tag in the Replace with string which would be replaced with the field specified in the dropdown list next to the << button when the VBScript expression is turned on (this allows more generic presets that could be used with any selected field instead of hard-coded ones in the Replace with string);
* Added: Series, Director, Producer, Actor, Parental Rating, Episode #, Season # and Type (new) fields. [MM4];
* Changed: old Type field to Extension, Original Album Title to Original Title, Skip Counter to Skipped # (please update your own presets that contain these fields);
* Added: 36 new presets, most of them using the new possibility with the <From Field> tag; the most important new preset is "Swap <From Field> and <Into Field>" which shows how it is possible to use single preset to modify two or more fields at once; some old presets are fixed;
* Fixed: case modification of Path/Folder.

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

Posted: Tue Jun 21, 2011 7:39 pm
by kiwichick
I've installed the new version but I have a problem with the Type field. This is my preset:

Image

If I run it from there I get this:

Image

And if I run it from the toolbar button I get this:

Image

I've tried it on MM4 and MM4Portable with the same result.

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

Posted: Wed Jun 22, 2011 3:35 pm
by ZvezdanD
kiwichick wrote:I've installed the new version but I have a problem with the Type field.
Thanks for the report. There is the new release, v4.2.1 - 2011-06-22:
* Fixed: error when replacing Type field [MM4].

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

Posted: Wed Jun 22, 2011 7:37 pm
by kiwichick
Fabulous!!!! Thanks so much. I really missed my REFR!!!! And that new field is great!!!

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

Posted: Sat Jul 02, 2011 3:45 pm
by cheerios
Hello,

Very nice addon. I'm no expert in regular expressions and I was wondering if someone can help:-)

I have some filenames in the following format:

PodcastName_Jun3011_Track 04.mp3

I'd like to set the Title Tag of the mp3 to be '2011-06-30 Track 04'

Any ideas how to this in a relatively painless manner?

Thanks much!

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

Posted: Sat Jul 02, 2011 5:45 pm
by ZvezdanD
cheerios wrote:I have some filenames in the following format:

PodcastName_Jun3011_Track 04.mp3

I'd like to set the Title Tag of the mp3 to be '2011-06-30 Track 04'
Find what: ^.*
Into: Title
Regular expression 1: checked
Replace with:

Code: Select all

Eval(IIf(Len(RegExp(oSongData.Path, SetVar(0, "^(?:.+?)\\(?:.+)\\(?:PodcastName_(.*?)(\d\d?)(\d\d)_(Track \d\d))\.(?:[^\.\\a-z]+)$"), 0)), "DateISO(CDate(RegSub(oSongData.Path, GetVar(0), ""$1/$2/$3""))) & RegSub(oSongData.Path, GetVar(0), "" $4"")", """$&"""))
VBScript expression: checked

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

Posted: Sat Jul 02, 2011 11:27 pm
by cheerios
Wow, thanks so much for the speedy response! I really appreciate you taking the time and effort to whip that up. I've defined a new preset as directed but I have not been able to get it to work yet. Still trying to figure out if I goofed up something. If you have any suggestions that might help debugging this, i'd be glad to hear them :-)

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

Posted: Sun Jul 03, 2011 3:03 am
by ZvezdanD
cheerios wrote:I've defined a new preset as directed but I have not been able to get it to work yet.
Could you be a little bit more descriptive what is wrong? What is the version of the add-on that you are using? Could you post the screenshot of the RegExp dialog box?

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

Posted: Sun Jul 03, 2011 7:07 am
by beg
Hi,

can you tell me if regexp in it's latest version is running on MM 4 beta?

cheers,
Bernhard