help me debug my "word capitalizer" script

Kamil Kuduk kamil.kuduk at gmail.com
Wed Aug 22 06:28:18 EDT 2012


> Purpose of the script:
> To capitalize the first letter of any word in a given file, leaving
> words which have 3 or less letters.

First or all? If first and this is the only purpose of the script you
can easily use sed:
less file.txt | sed -e "s/\b\([a-z]\{4,\}\)/\u\1/g"



More information about the Python-list mailing list