small letters

You want to change all capital letters into small letters. But then you want to change the first letter of a word into a capital letter. Your content is stored in r1.txt. The result of the script is stored in r2.txt