I need a script in any language to capitalize the first letter of every word in a file.
Thanks for all the answers.
Stackoverflow rocks!
If using pipes and Python:
$ echo "HELLO WORLD" | python3 -c "import sys; print(sys.stdin.read().title())"
Hello World
For example:
$ lorem | python3 -c "import sys; print(sys.stdin.read().title())"
Officia Est Omnis Quia. Nihil Et Voluptatem Dolor Blanditiis Sit Harum. Dolore Minima Suscipit Quaerat. Soluta Autem Explicabo Saepe. Recusandae Molestias Et Et Est Impedit Consequuntur. Voluptatum Architecto Enim Nostrum Ut Corrupti Nobis.
You can also use things like strip() to remove spaces, or capitalize():
$ echo " This iS mY USER ${USER} " | python3 -c "import sys; print(sys.stdin.read().strip().lower().capitalize())"
This is my user jenkins