[portland] Script to Change UPPER CASE to Mixed Case

Rich Shepard rshepard at appl-ecosys.com
Tue Sep 22 02:10:24 CEST 2009


   Before I re-invent the wheel I'm looking for a script that will read a
text file and convert all uppercase strings to proper case (i.e., first
letter capitalized, all others lowercase). I don't find one in the Python
Cookbook.

   I've downloaded -- as .csv files -- a bunch of databases from an Oregon
state agency. It's obvious from the different formats used for the same
fields that their SQL Server application does no checking to ensure that all
data are entered in a uniform way. Because I don't like to have database
records like this, and I don't want to manually correct several thousand
records, I'd like a script to do the work for me.

   Each row has 25 columns; 22 are TEXT, one is INTEGER, and two are REAL.
The text fields are almost all in uppercase; but not all are.

   I'd appreciate pointers to where I might find such a script through which
I can pass the text file.

TIA,

Rich


More information about the Portland mailing list