INTERACT FORUM

Please login or register.

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

Author Topic: Expression question - "subtracting" one field from another?  (Read 894 times)

fitbrit

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4887

If I enter in a blank field, say, [title]: =[name] - [episode], I'll get exactly that, e.g. Star Trek TOS S01E29 - Operation Annihilate, if the [name] were Star Trek TOS S01E29, and the [episode] were Operation Annihilate. However, what if I wanted to do the opposite, for example to generate an [episode] field entry, from the [title] and [name] fields, knowing that the [name] is a subset of the [title] field.
i.e. I want something like: =remove([name],[title])

I understand that I could simply count how many characters are to the left of Operation Annihilate in the [title] field and then do a removeleft() expression, or indeed just use a right() expression, but I'm looking for a general solution to apply to thousands of files at once.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: Expression question - "subtracting" one field from another?
« Reply #1 on: May 12, 2011, 01:48:02 am »

It's a bit hard to visualise exactly what you are after here, but, could you perhaps use the listitem() function?

The delimiter can be anything you specify, so if [title] contained "I am not name - I am name"

entering: =listitem([title],1,/ - ) into the [episode] field would populate episode with "I am name"

-marko

fitbrit

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4887
Re: Expression question - "subtracting" one field from another?
« Reply #2 on: May 12, 2011, 02:34:04 am »

Thanks, I'll look into this when I'm not so tired!
Logged
Pages: [1]   Go Up