> 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"
--
http://mail.python.
On Wed, Aug 22, 2012 at 12:41 PM, Chris Angelico wrote:
> Why less? Why not just redirect input?
Yeah, my bad, I somehow used to do it, for grep too, and I know that
this is slower
> Though, this isn't really on topic for Python.
I would still go with regexp, something like:
with open('myfile.t