INTERACT FORUM

Please login or register.

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

Author Topic: [24.0.41; Query—Answered] Move leading articles to end of string  (Read 776 times)

Gatherum

  • Citizen of the Universe
  • *****
  • Posts: 651

Good morning. This specifically concerns the Rename, Move, & Copy feature, and possibly the expression language in general.

How might I use that tool to move any leading articles (a, an, the...) appearing in the [Album Artist (auto)] field to the end? So, in the case of a band like, say, The Chant, MC would create a directory named Chant, The instead. This hypothetical function would ideally reference the list of articles in Tools > Options... > Tree & View > Sorting.

Perusing the wiki with a Ctrl+F to find "articles", I stumbled upon the Clean function which can effect automatic removal but this is not the intent. Perhaps a fifth mode can be added to this function that moves articles instead?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: [24.0.41; Query] Move leading articles to end of string
« Reply #1 on: July 29, 2018, 01:41:42 am »

Gatherum

  • Citizen of the Universe
  • *****
  • Posts: 651
Re: [24.0.41; Query] Move leading articles to end of string
« Reply #2 on: July 29, 2018, 02:12:47 am »

Ooh, that's promising!

...But it doesn't appear to be tailored for library fields without semicolon delimiting. What would it do if I used Swap([Album Artist (auto)])?
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: [24.0.41; Query] Move leading articles to end of string
« Reply #3 on: July 29, 2018, 03:09:01 am »

MoveArticles(string)

Description: 
Takes The Beatles and reverses it to Beatles, The.

The MoveArticles() function is similar to the Swap() function, except that it operates on strings with prefixed articles (such as "The Beatles" or "A Flock of Seagulls".)

Examples:
    MoveArticles(The Beatles)
        Moves the article to the end of the name Beatles, The.

https://wiki.jriver.com/index.php/String_Manipulation_Functions#MoveArticles.28.E2.80.A6.29
Logged

Gatherum

  • Citizen of the Universe
  • *****
  • Posts: 651
Re: [24.0.41; Query—Answered] Move leading articles to end of string
« Reply #4 on: July 29, 2018, 04:01:02 am »

MoveArticles(string)

Description: 
Takes The Beatles and reverses it to Beatles, The.

The MoveArticles() function is similar to the Swap() function, except that it operates on strings with prefixed articles (such as "The Beatles" or "A Flock of Seagulls".)

Examples:
    MoveArticles(The Beatles)
        Moves the article to the end of the name Beatles, The.

https://wiki.jriver.com/index.php/String_Manipulation_Functions#MoveArticles.28.E2.80.A6.29

Oh, darn! I wonder why that didn't come up in Ctrl+F...

This does precisely what I want. Thank you! ^^
Logged
Pages: [1]   Go Up