[TxMt] How to target specific fields for a "Change to Titlecase" in SQL

John Stephens john at designop.us
Fri Aug 8 19:24:19 UTC 2008


Hi, I'm new.

I'm working on a custom Textpattern installation and my client has  
entered a massive amount of text data in certain fields using  
UPPERCASE. He wants the text displayed in Title Case instead, and he  
doesn’t want to manually change it. I can easily use the style  
declaration "text-transform: capitalize;" for these elements, but my  
client would very much prefer formal title case in which words such  
as “the,” “of,” “and,” and “for” are not capitalized. (I see that  
Textmate’s "Convert to Titlecase" command in the "Text" menu does  
this correctly.)

I have made a mysql dump of the database, but I'm not sure how to  
isolate the appropriate data for a text transformation. Here is how  
each individual record is formatted in the database:

(91,'2008-08-03 05:20:57','author-username','2008-08-03  
05:26:33','','UPPERCASE DATA','','','','','','','UPPERCASE-DATA','', 
0,'Comment',0,4,1,1,'section-name','','lowercase-data','lowercase- 
data','','','','','','','','','','','UPPERCASE DATA','','lowercase- 
data','3p344629nn178n874sp2s222s0q3n072','2008-08-03')

The mysql dump also contains uppercase terms such as "DROP TABLE IF  
EXISTS" and lowercase terms like "datetime" and "varchar" that I  
_don't_ want changed. Is there a simple way to target just the  
UPPERCASE DATA fields enclosed in single quotes for a massive "Covert  
to Titlecase"?

I welcome advise from regular expression fu-masters and Textmate adepts!

Thanks in advance!
John Stephens


More information about the textmate mailing list