Hi
I am using the sortName to move the opening 'The' to the end of the name and have inserted it in brackets. However, I prefer to limit it to moving 'The' and not 'A' or 'An' because I have so few of these. I don't know whether the Groovy code can be amended to do that but unfortunately I do not understand its syntax.
How can I just move 'The' and not 'A' or 'An'?
Custom Sort Name
Re: [SNIPPET] Sort Name
Are you using the GUI ?
If not, DO IT!
You should try playing around with formats, by adding/deleting stuff
e.g. you use
some of it is filebot only, but mostly you can use java / groovy code...
and in this case also Regular expression https://en.wikipedia.org/wiki/Regular_expression
so try just to remove the part "|A|An" you know you dont want and then you get
DONE 
PS: google the stuff you dont understand
btw: I think my way is better, try this:
now the "MOVIE, The (YEAR)"
instead of "MOVIE (YEAR), The" that you get with
if you want to reverse it back to the front then try e.g. :
If not, DO IT!
You should try playing around with formats, by adding/deleting stuff
e.g. you use
Code: Select all
{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)}
and in this case also Regular expression https://en.wikipedia.org/wiki/Regular_expression
so try just to remove the part "|A|An" you know you dont want and then you get
Code: Select all
{n.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)}

PS: google the stuff you dont understand

btw: I think my way is better, try this:
Code: Select all
{ny.replaceFirst(/^(?i)(The|A|An)\ (.+[^\ \(\d{4}\)])/, /$2, $1/)}
instead of "MOVIE (YEAR), The" that you get with
Code: Select all
{ny.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)}
Code: Select all
{folder.name.replaceFirst(/^(.+),.(?i)(The|A|An)/, /$2 $1/)}/{fn}
Re: [SNIPPET] Sort Name
Thank you. Using that enabled me to work out the expression I needed. Can I just check - when you refer to using the GUI, do you mean the one you see by editing the preset and clicking on the icon to the right of the Expression in the Preset Editor?
I have one more question for now but I will create a new thread as I haven't found the answer and it relates to a different aspect.
I have one more question for now but I will create a new thread as I haven't found the answer and it relates to a different aspect.
Re: [SNIPPET] Sort Name
using your script above: {ny.replaceFirst(/^(?i)(The|A|An)\ (.+[^\ \(\d{4}\)])/, /$2, $1/)}
can you please add the code to replace colon (:) with dash ( - )
thank you
can you please add the code to replace colon (:) with dash ( - )
thank you