Normal Topic Imported Text Formatting (Read 599 times)
nateboone
Junior Member
**
Offline



Posts: 54
Joined: Dec 19th, 2006
Imported Text Formatting
May 23rd, 2007 at 12:20am
Print Post Print Post  
Hey guys--

I've got a database that I regularly import info from a .CSV file which in turn gathers basic info from requests made on our website.  I'm trying to figure out some programming to make the formatting of our input info little bit more uniform so that we don't have to do so much manual formatting... specifically having to do with upper and lower case.

For instance... many times kids on our site make requests in all caps, so I need some programming to transfer "123 WEST FOREST ST." to "123 West Forest St."  Its a cinch to transfer everything to lower case, but how to capitalize the first letters of each word?  Thanks!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Imported Text Formatting
Reply #1 - May 23rd, 2007 at 12:58am
Print Post Print Post  
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
nateboone
Junior Member
**
Offline



Posts: 54
Joined: Dec 19th, 2006
Re: Imported Text Formatting
Reply #2 - May 23rd, 2007 at 1:22am
Print Post Print Post  
Yes... wonderful!  Thanks!  Glad I didn't have to reinvent the wheel there...  Smiley
  
Back to top
 
IP Logged
 
nateboone
Junior Member
**
Offline



Posts: 54
Joined: Dec 19th, 2006
Re: Imported Text Formatting
Reply #3 - May 23rd, 2007 at 3:06am
Print Post Print Post  
How would you suggest inserting exceptions into this code, such as "SW" or "P.O. Box" or names like "McDonald"?

Thanks!
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Imported Text Formatting
Reply #4 - May 23rd, 2007 at 12:09pm
Print Post Print Post  
nateboone wrote on May 23rd, 2007 at 3:06am:
How would you suggest inserting exceptions into this code, such as "SW" or "P.O. Box" or names like "McDonald"?

Thanks!


Yeah, that 's the problem with Title Case. I'd probably use an array to make a table of exceptions.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged