If file begins with "The", move to ...

Advanced Renamer forum
#1 : 02/11-24 22:05
Ted Williams
Posts: 4
If a file begins with "The", is there a way for AR to:
- move "The" (and the space) to the end of the title but before the date
- add a comma and a space before "The"

Example:

Original name: The Other Guys (2010)

New name: Other Guys, The (2010)

Any help is greatly appreciated.

#2 : 02/11-24 22:45
Delta Foxtrot
Posts: 323
Reply to #1:

Hi Ted,

Absolutely! Very easy too. Use a replace method:
(No quotes, they're just to demonstrate the spaces)
Replace: "^The (.*) \("
Replace with: "$1, The ("
Occurrence: All
Case sensitive: NO
Use regular expressions: CHECKED
Apply to: Name

The only thing that would mess it up is if there's a parenthesis in your name before the parenthesis around the date. Unless THAT parenthesis had a date (nnnn) inside it, you could just use this instead:

EDIT: Oops! I had to get food out of the oven and got careless. I've fixed it now. END EDIT

Replace: "^The (.*) (\(\d{4})"
Replace with: "$1, The $2"
(everything else the same)

Best,
DF

edited: 03/11-24 00:42
#3 : 03/11-24 00:46
Delta Foxtrot
Posts: 323
Reply to #2:

In thinking about this, neither of these will work correctly if you have for instance:

"The Other Side of Midnight (remastered) (1975)"

In that case you'd get "Other Side of Midnight (remastered), The (1975)"

It probably won't come up, but I'm known for my over-sharing. :)

Best,
DF