I’m in a all SQLenvironment, so I need as “all SQL” an answer as possible.
Can’t sell inserting a chunk of Java or whatever into an environment with no resources for that language.
Anyone ever have to deal with a complicated “de-CAPITALIZING” situation?
I have a mass of addresses which were capitalized.
I need them back (pretty much) normal.
I can’t use PROPER-type commands directly because addresses are full of words like:
IBM WTC MDF PA IDC PO NE – too many to enumerate in this large a set,
which have to stay capitalized.
So here is my plan:
1) Parse it out and Proper() every word EXCEPT those of 3 letters or less
Then:
2) have a list of “special cases” to Proper() – these (seem to be) a small enumerable set:
RIO AVE AND BOX EL 2ND…
3) have a list of “special cases” to LCase() – these (seem to be) a small enumerable set:
DE LA …
…DE LA LAGUNA RIO AVE AND EL PASO 2ND FL IBM PTO OFFICE PO BOX
…DE LA Laguna RIO AVE AND EL Paso 2ND FL IBM PTO Office PO BOX
…DE LA Laguna Rio Ave And El Paso 2nd FL IBM PTO Office PO Box
…de la Laguna Rio Ave And El Paso 2nd FL IBM PTO Office PO Box
Any thoughts? I’m sure people have faced this kind of all capital situation in the past.
So:
- I need a piece of SQL to parse on “space”, cycle through each token (I can add whatever logic within the loop) and rebuild each address
- Better ideas on how to do this?