I have data on addresses where I would like to create a new variable that includes only the state. The problem is that the data is by no means uniform: some examples have only the state abbreviation, some have punctuation, some have the full name spelled out, some don't have a state at all. There are few discernible patterns. If I could at least isolate the ZIP code when it it is included, this would be a first step because I could then merge it with a database of zip codes and states. Any thoughts on how to best proceed welcome.
Thank you in advance!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input strL address "#25 Mason Complex" "% The Marvin M. Schwan Charitable Foundation; 514 Earth City expressway; Suite 233; Earth City; Missouri 63045; U.S.A." "@ Yunita; c/o Apt 501; 1201 Boylston Avenue; Seattle; WA 98101; USA" "020 ORIONCT; SANLEANDRO; CA 94579 USA" "19 ANDALUCIA; IRVINE; CA 92614; USA" "19 BRISTOL DRIVE NO BRUNSWICK NJ 08902." "19 BROTH BRUNSWICK NJ 08902." "19 Canterbury CT chesapeake City, MD 219151835 USA" "19 MOUNTAIN ROAD VERNON USA" "19 SCOTT DRIVE MELVILLE NEW YORK 11747 USA" "1 Aventura Executive Center; Suite 514; Aventura Florida 33180" "1 Brave Eagle CT, USA" "1B Shumskogo U. st. of." "1 BUCCANEER ST.; VENICE; CAL. 90292; U.S.A." "1 Chase Manhattan Plaza; Floor 58; New York; NY 10005; USA" "1 DEERFIELD RD, SHORT HILLS NJ 07078-1403" "1 RIDGEWOOD CLOSE #15-03 RIDGEWOOD CONDOMINIUM S(276692)" "1ST FLOOR, PACIFIC BUILDING" "1000 S. POINT DR; Apt. 1107; MIAMI BEACH FL 33139" "1000 S. POINT DR; Apt. 1107; MIAMI BEACH FL 33139 USA" "1000 WAVERLY WAY KIRKLAND WA 98033-4806 INARY SHS" "10011 BLOOMBERG S W OLYMPIA WA 98502" "10015 NE 4TH ST 4003BELLEVUE WA 98004-4947" "1001 ALEXANDER HOUSE" "1001 College Ct; New; Bern; North Carolina; 28562" "10021 63RD PLACE W EVERETT WA 98204" "1002 N 27TH PLACE RENTON WA 98056-1474" "1003 124TH PL NW MARYSVILLE WA 98270" "10033 SW 77 CT Miami, FL 33156-2678 U. S. A." "1005 SE 136TH AVE D28 VANCOUVER WA 98683-7178 INARY SHS" "10062 DEVILLE DR MORENO VALLEY CA 92557, USA." "1009 GLEN ST EDMONDS WA 98020-2948" "1009 N.E. 204 LANE - MIAMI - FL 33179 USA" "1009 WESTERN AVE APT 1111 SEATTLE WA 98104-1038" "100 ANDALUSIA AVE.; SUITE 304; CORAL GABLES; FL 33134" "100 Chimney Drive; Ogdensburg; New York 13669-2289; U.S.A." "100 N. BARRANCA AVE. #810 WEST COVINA; CALIFORNIA 91791; U.S.A." "100 TIMBER RIDGE WAY NW APT 1108 ISSAQUAH WA 98027-8983" "100 West Elm Street; Suite 400; Conshohocken; PA 19428; USA" "1010 5th Ave # 7A New York NY United States of America 10028-0130" "101 101st SE; Unit C -202; Bellevue; WA 98004; USA" "10117 MARINE VIEW DR MUKILTEO WA 98275-4503" "10119 LINDA ANN PLACE CUPERTINO, CA95014 USA" "1011 Camino Del Rio South; San Diego; CA 92108 USA" "10129 40TH AVE SE EVERETT WA 98208-4655" "10132 E Desert Sage; Scottsdale; AZ85255; USA" "101.388 SHARES" "1013 Centre Road; City of Wilmington; County of New Castle; Delaware.U.S.A" "1013 Centre Road; Wilmington; Delaware 19805-1297 USA" "1013 CENTRE ROAD WILMINGTON DELAWARE, USA" "1013 N 42ND PL RENTON WA 98056-2163" "101 Main Street; Suite One; Tappan NY 10983; United States of America" "101 Orchard Park PL; Hayward CA 94544-1242; U.S.A." "101 Seabreeze Blvd. Apt. 217 Daytona Beach FL. 32118, USA" "101 WARREN STREET; NEW YORK; NY 10007" "10205 Madrid Drive; Gilroy; CA 95020 USA" "10223 EARLEY AVE SW TACOMA WA 98499-4726" "10225 OAK LANE SW TACOMA WA 98499-1743" "1022 WESTRIDGE AVEENUE; SUITE 400; DANVILLE; CALIFORNIA 94526; U.S.A." "10231 Brighton Circle; Twinsburg; OH 44087; USA" "1026 BELLEVUE WAY SE BELLEVUE WA 98004-6834" "10275 Collins Avenue; Apt. 1221; Bal Harbour; FL 33154; United States" "10305 SW 55th Avenue Coral Gables Florida USA" "10307 TOLEDO RD SPRING VALLEY CA 91977-1737" "1030 HAWTHORNE LANO FORT WASHINGTON" "1030 HAWTHORNE LANO FORT WASHINGTON USA" "10311 SE 28TH ST BELLEVUE WA 98004-7226" "10311 SE 28TH STREET BELLEVUE WA 98004-7226" "10330 Lake Road; Unit U; Houston; TX 77070; USA." "10333 Harwin Drive; Suite 550; Houston; Texas 77036; U.S.A." "1034 BUENA VISTA TACOMA WA 98466-6707" "10358 RIVIERA PLACE N E SEATTLE WA 98125-8162" "1037 SE 2ND COURT; FORT LAUDERDALE; FLORIDA 33301; U.S.A." "103 S 214TH SEATTLE WA 98198-3043" "103 S 214TH SEATTLE WA 98198-3043 INARY SHS" "103 SOUTH 214TH SEATTLE WA 98198-3043" "103 tindall lane" "10405 N E 52ND STREET KIRKLAND WA 98033-7601 INARY SHS" "10409 Hunter Ridge Drive; Oakton; VA; 22124 USA" "10414 PEACOCK HILL AVE NW 60 GIG HARBOUR WA 98332-8903" "10.415 SHARES" "10428 Canoga Ave; # 304; Chatsworth CA; 91311; United States of America" "10440 Beach Blvd. #571; Stanton CA 90680-0571; U.S.A." "1045 Millview Dr.; Batavia; Illinois 60510; U.A.S." "1047 Overlook Drive; Bogart; GA 30622; USA." "104 Paloma Drive Coral Gables, FL 33143" "10503 NE 120TH PL KIRKLAND WA 98034-3921" "1052 SIERRA DRIVE; MENLO PARK CA; 94025; CALIFORNIA; USA" "105 3216 NE 45TH PLACE SEATTLE WA 98105" "1057 DALEY ST EDMONDS WA 98020-2943 INARY SHS" "1057 TANFORD LANE; CORONA CALIFORNIA; 91719 USA" "105 Duane Street; Apt 42G; New York 10007; USA" end
0 Response to Cleaning Messy Address Data
Post a Comment