INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Tag Help  (Read 2061 times)

realmassy

  • Recent member
  • *
  • Posts: 16
Tag Help
« on: December 13, 2012, 02:11:37 pm »

Hello,
First of all thanks for this great software, I'm loving JRiver!
I need some help in tagging my classical music collections: I'm tagging the album using the composer work title (String Quartet No. 12, Op. 127 for example) and I'd like to copy the last bit of the title (Op. 127) to a new custom tag, for sorting purpose. I've already created the tag and I'm setting the value for my new music but I want to clean up the collection. Can someone help me?
Maybe I can do it with an expression? I basically need to get the last part of the album title, after the last ', '

Thanks in advance.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71603
  • Where did I put my teeth?
Re: Tag Help
« Reply #1 on: December 13, 2012, 02:20:50 pm »

There is a topic on Expressions on our wiki.

This thread might also help:
http://yabb.jriver.com/interact/index.php?topic=45824.0
Logged

realmassy

  • Recent member
  • *
  • Posts: 16
Re: Tag Help
« Reply #2 on: December 13, 2012, 02:32:44 pm »

Thanks for your quick reply Jim. I'm actually trying to use a regex to extract the value using the regex function...I'm not an expert so I'm struggling a bit! I'll post it on the classical music tagging thread.
In the meantime any help is appreciated :-)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Tag Help
« Reply #3 on: December 13, 2012, 02:54:25 pm »

How is the "last bit" characterized?  Is it the stuff that always follows the last comma?  Is it always Op. ###, or other?  If you can explain this, or show all the examples, I'll provide you with a regex.
Logged
The opinions I express represent my own folly.

realmassy

  • Recent member
  • *
  • Posts: 16
Re: Tag Help
« Reply #4 on: December 13, 2012, 03:47:34 pm »

This is my attempt, definitely not pretty but seems to work:
If(Regex([Album], /#(.*),#/ , 0),RemoveLeft(RemoveLeft([Album], Length(Regex([Album], /#(.*),#/ , 1))), 2),)

Basically I'm checking if there's 'something' after the last comma, and in case remove it from the album tag (using the length), and then remove 2 more chars (", ")

The album title format (the last bit) is always ", <<catalog name>> <<catalog number>>"
Example:
", Op. 127"
", Op. 18 No. 2"
", BWV 82"
", K. 515"

Hope it's more clear now!
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Tag Help
« Reply #5 on: December 13, 2012, 04:11:27 pm »

This will return the last part if that is all you want:

  ifelse(Regex([Name], /#, (.+)$#/), [R1])

and return nothing if there is no comma followed by a space.
Logged
The opinions I express represent my own folly.

realmassy

  • Recent member
  • *
  • Posts: 16
Re: Tag Help
« Reply #6 on: December 13, 2012, 04:19:05 pm »

Cool, looks cleaner, I'll try and let you know. Cheers for now
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Tag Help
« Reply #7 on: December 13, 2012, 06:22:30 pm »

Indeed.  You can use Regex() to pull out only the parts you need.

If that's all you want, you can use the simpler:

   Regex([Name], /#, (.+)$#/, 1)

without the conditional, since this will output either what was matched, or nothing at all.
Logged
The opinions I express represent my own folly.

realmassy

  • Recent member
  • *
  • Posts: 16
Re: Tag Help
« Reply #8 on: December 25, 2012, 11:30:24 am »

A bit late, sorry! The regex works perfectly, I've assigned it to a new field and then copied the value over the missing 'Opus Number' field that I had already setup. Thanks again for your help.
Logged
Pages: [1]   Go Up