Capitalize first letter from first word only

All about user-defined episode / movie / file name format expressions
Post Reply
rockas
Posts: 3
Joined: 20 Nov 2015, 13:44

Capitalize first letter from first word only

Post by rockas »

I want to rename my files by making capital only the first letter of the first word of series name and episode title.

For example i want to rename this

Code: Select all

How.I.Met.Your.Mother.1x03-The.Sweet.Taste.of.Liberty.720p.DIM.mkv
To that

Code: Select all

How i met your mother 1x03 - The sweet taste of liberty.mkv
And NOT to this

Code: Select all

How I Met Your Mother 1x03 - The Sweet Taste of Liberty.mkv
Thanks in advance,
RoCkAs
Last edited by rockas on 20 Nov 2015, 16:22, edited 1 time in total.
rockas
Posts: 3
Joined: 20 Nov 2015, 13:44

Re: Rename - Please help

Post by rockas »

I have managed to do the above with this format

Code: Select all

{n[0].upper()}{n[1..(n.length()-1)].lower()} {sxe} - {t[0].upper()}{t[1..(t.length()-1)].lower()}
User avatar
rednoah
The Source
Posts: 23935
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename - Please help

Post by rednoah »

Very good! You can make it slightly shorter by using negative indices:

Code: Select all

{n[1..-1].lower()}
@see http://mrhaki.blogspot.tw/2009/03/use-n ... ts-to.html
:idea: Please read the FAQ and How to Request Help.
rockas
Posts: 3
Joined: 20 Nov 2015, 13:44

Re: Rename - Please help

Post by rockas »

rednoah wrote:Very good! You can make it slightly shorter by using negative indices:

Code: Select all

{n[1..-1].lower()}
@see http://mrhaki.blogspot.tw/2009/03/use-n ... ts-to.html
Oh thank you very much!!! :D :D Just an example from your response...

Code: Select all

{n[0].upper()}{n[1..-1].lower()} {sxe} - {t[0].upper()}{t[1..-1].lower()}
Post Reply