Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #27626 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2012-08-22 20:41 +1000 |
| Last post | 2012-08-22 20:41 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: help me debug my "word capitalizer" script Chris Angelico <rosuav@gmail.com> - 2012-08-22 20:41 +1000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-08-22 20:41 +1000 |
| Subject | Re: help me debug my "word capitalizer" script |
| Message-ID | <mailman.3644.1345632103.4697.python-list@python.org> |
On Wed, Aug 22, 2012 at 8:28 PM, Kamil Kuduk <kamil.kuduk@gmail.com> wrote:
>> 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"
Why less? Why not just redirect input?
Though, this isn't really on topic for Python.
ChrisA
Back to top | Article view | comp.lang.python
csiph-web