powah wrote:
How to change the first character of the line to uppercase in a text
file?
e.g.
input is:
abc xyz
Bd ef
gH ij

output should be:
Abc xyz
Bd ef
GH ij

While you're asking the Python list, I'd just use GNU sed:

  sed -i 's/./\U&/' myfile.txt

I don't know if the "\U"=="make the replacement uppercase" is a GNU-sed specific thing, but it works here on my Debian box's version 4.1.5 when I tested it.

-tkc




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to