Forum Moderators: open

Message Too Old, No Replies

Uncapitalize words in database

         

switchjohnny

6:58 pm on Nov 5, 2007 (gmt 0)

10+ Year Member



In one of my databases, I have some words that are in all caps. Is there a way to change them all to lowercase, or lowercase with the first word capitalized?

Example

MYWORD - is like this
Myword - I want it like that.

Only 1 field is like this, the other fields are ok, so I would just need to apply this to a single field.

Something like
UPDATE table SET fieldname ='lowercasewords' WHERE fieldname ='UPPERCASEWORDS';

LifeinAsia

7:47 pm on Nov 5, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



It depends on your DB- most have functions for upper/lowercasing. As for initial caps only, you may have to custom make something.

For MS SQL:
UPDATE Table SET
Fieldname=LOWER(Fieldname)

phranque

1:02 am on Nov 6, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i don't think you can capitalize words or "a sentence" in sql but you can do it in a perl or php script, for example.
you can also do it in css if that helps.

this previous WebmasterWorld thread may be helpful:
[webmasterworld.com...]

switchjohnny

6:11 am on Nov 6, 2007 (gmt 0)

10+ Year Member



I just ended up doing it in excel and re uploaded my database.

Thanks for the help though.