> 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.org/mailman/listinfo/python-list