How to move some letters, change to lower case and add comma

Bulk Rename Utility How-To's

How to move some letters, change to lower case and add comma

Postby Guy » Tue Dec 20, 2022 7:26 pm

Hi,

I have many movie name examples like below that I need to move those "definite article" [ The ] from the beginning to the end of names and change to "lower case" while a "comma" is placed before that. Can "Regex" do it? What regex for this case?

I'd change my current names to in front examples:
The Hound of the Baskervilles (1939) =========> Hound of the Baskervilles, the (1939)
The House Of The Devil (2009) ==========> House Of The Devil, the (2009)


The Hound of the Baskervilles (1939)
The House Of The Devil (2009)
The Hills Have Eyes (1977)
The Hound of the Baskervilles (1939)
The House Of The Devil (2009)
The Hunt (2020)
The Infernal Machine (2022)
The Italian Job (1969)
The Kings Man (2021)
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: How to move some letters, change to lower case and add comma

Postby Admin » Wed Dec 21, 2022 1:20 am

Try

RegEx (1)
Enable v2

Match: (The) (.*)
Replace: \2, \L\1

\L means lowercase.

thanks
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: How to move some letters, change to lower case and add comma

Postby Guy » Wed Dec 21, 2022 9:43 am

Admin wrote:Try

RegEx (1)
Enable v2

Match: (The) (.*)
Replace: \2, \L\1

\L means lowercase.

thanks


It works, but "comma" and "the" went after the parentheses. Need they placed after movie names, before the parentheses as below.

example: [movie name] - [comma] - [the] - [date]
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: How to move some letters, change to lower case and add comma

Postby Admin » Thu Dec 22, 2022 3:13 am

Hi, try

Match: (The) (.*) \((.*)\)
Replace: \2, \L\1 \(\3\)
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: How to move some letters, change to lower case and add comma

Postby Guy » Thu Dec 22, 2022 7:35 am

Admin wrote:Hi, try

Match: (The) (.*) \((.*)\)
Replace: \2, \L\1 \(\3\)


Great job Admin, would you please tell me how to add "space" (one single space key) after parenthesis? Above RegEex is fine, but "the" and the first "parenthesis" are too close to each other and need a "space" key between them.

Current: Queens Gambit, the(2020)

Changed: Queens Gambit, the (2020)
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: How to move some letters, change to lower case and add comma

Postby Admin » Fri Dec 23, 2022 1:30 am

What is the original name for this file? thanks
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: How to move some letters, change to lower case and add comma

Postby Guy » Fri Dec 23, 2022 7:59 am

Admin wrote:What is the original name for this file? thanks


Hi Admin,

Sorry I was mistaken the RegEx characters you posted were right and I inserted them manually before, so get the wrong result, this time I copy & pasted them and get the right result as I wished. Thank you!
Guy
 
Posts: 16
Joined: Wed Jan 19, 2022 8:27 am

Re: How to move some letters, change to lower case and add comma

Postby Admin » Fri Dec 23, 2022 10:29 am

Hi Guy, glad that it's working now! 8)
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To