INTERACT FORUM

More => Old Versions => JRiver Media Center 18 for Windows => Topic started by: kstuart on February 25, 2013, 12:03:49 pm

Title: "Find And Replace" with expressions ?
Post by: kstuart on February 25, 2013, 12:03:49 pm
Can you use expressions in Find And Replace (for Fields) ?

In other words, "If exist blah blah, then replace [Description] with [Album]" and similar.

I'm basically looking for functionality similar to both Find And Replace, and Move/Copy Fields, but with a) only portions of the fields, and b) depending on certain conditions.

Title: Re: "Find And Replace" with expressions ?
Post by: MrC on February 25, 2013, 12:14:08 pm
Nope.
Title: Re: "Find And Replace" with expressions ?
Post by: kstuart on February 25, 2013, 12:42:36 pm
Okay, so those are both as they appear.

So, is there a way to do the following:

If [Album] contains either a [ or a (

Then move that character - and everything after it - to [Description]

For example,

Album            Dark Side of the Moon [30th Anniversary Remaster]

becomes

Album            Dark Side of the Moon

Description    30th Anniversary Remaster

(I've previously seen it explained how to make a View based on these conditions, but not how to actually move the tag information based on these conditions.)
Title: Re: "Find And Replace" with expressions ?
Post by: MrC on February 25, 2013, 01:04:21 pm
Set Description first with:

   =Regex([album], /#^(.+?)(?:\s*\[(.+)\])?$#/, 2)

and then followup by changing Album with:

   =Regex([album], /#^(.+?)(?:\s*\[(.+)\])?$#/, 1)

Both are the same expression, with just the capture value changed.  You can setup two expression columns to see that it works.
Title: Re: "Find And Replace" with expressions ?
Post by: kstuart on February 26, 2013, 04:38:37 pm
I think there is a problem with the Tag Window editing style for "Description" Tag.

No matter what I do, the "Description" stays as - literally :

 =Regex([album], /#^(.+?)(?:\s*\[(.+)\])?$#/, 2)

Unlike other tag editing, Description puts "Enter" into the string as a carriage return, so there seems no way to cause the expression to "execute".
Title: Re: "Find And Replace" with expressions ?
Post by: MrC on February 26, 2013, 04:57:53 pm
After you enter the expression, just close the box and it will evaluate.
Title: Re: "Find And Replace" with expressions ?
Post by: kstuart on February 26, 2013, 06:10:45 pm
Aha - I had a space at the beginning.  It does calculate when you close the box.

So far so good, it is definitely helpful.

What would be ideal would be an expression that:

* Started on the left end (IIRC smallest numbered character ?)
* When it encountered either a " [ " or " ( " or " { "
* Put everything else to the right, into Description - even if there are more of those characters

For example, I might have something like:

Dark Side of the Moon  (2003 remaster) [FLAC] {Doug Sax mastering}

and want everything after the first parenthesis to be in Description.

the cleaned up result that you provided previously (in other words, with brackets removed) is great, but not strictly necessary if multiple ones causes it to be too complicated.

Thanks !
Title: Re: "Find And Replace" with expressions ?
Post by: MrC on February 26, 2013, 06:18:50 pm
Use the following:

   =RemoveCharacters(Regex([album], /#^(.+?)(?:\s*[[({](.+)[\])}])?$#/, 1),/(/)[]{})

same as before 1 for Album, 2 for Description.
Title: Re: "Find And Replace" with expressions ?
Post by: kstuart on February 26, 2013, 08:58:20 pm
Works perfectly !   :o  :o

I hope some other readers have a use for this !
Title: Re: "Find And Replace" with expressions ?
Post by: glynor on February 26, 2013, 09:50:14 pm
MrC and his wonderful toys (http://www.youtube.com/watch?v=KA5II5AlO7w) again.  ;)
Title: Re: "Find And Replace" with expressions ?
Post by: MrC on February 27, 2013, 01:04:32 pm
Apparently I've always been mesmerized with and bewildered by toys.

(http://i1200.photobucket.com/albums/bb336/Mr__C/MC%20Screenies/michael-phone1_zpscc370009.jpg)