Changes

Jump to navigation Jump to search
=== Clean Address: more patterns ===
 
====Clean postcode & state====
Postcode should always be at the end of addrline1, addrlin2 or city. Exclude P.O. BOX #.
For example, the SQL code to extract postcode and state from addrline1 is:
SELECT SUBSTRING(addrline1, '\d{5}') postcode_clean,
SUBSTRING(addrline1, '[,]\s{1,}\w{1,}\s{0,}\w{0,}\d{5}') state_clean
FROM ptoassigneend_us_temp2
WHERE (addrline1 ~* '\d{5}$'
AND NOT (addrline1 ~* 'BOX'))
 
Examples:
 
====Clean city & state====
*Pattern 1: 'city' contains punctuation

Navigation menu