View Full Version : php / mysql for address abreviations


fourthring
02-18-2005, 12:36 PM
I have a client that has a database of addresses but the street names are in all types of formats:

ex:

1234 avenue
1234 ave
1234 blvd
1234 boulevard

I'd like to clean up all of the address abreviations to make it easier to do searches in mysql. Is there a function out there or will I need to do a regex to clean up and convert all ave. and avenues to ave, st to street, road, way, blvd, drive, highway, etc??

Thanks!

sarahk
02-19-2005, 09:47 AM
In a past life I had a job like this but cleaning them as they were imported. Its a big job and full of potential hazards.

Consider someone who lives in apartment 4. In New Zealand it would normally be written as 4/109 Whatever St

But if the apartment was on a crosslease it could be: 4/109c Whatever St
Then you get the pedantic person who puts it as: A4/109 Whatever St
Or the confused person: 109-4 Whatever St
And then the europeans: Whatever St 4/109

But the idea is good, just run lots of tests before the final commit looking for unusual results and back up you data.

Sarah