You are viewing limited content. For full access, please sign in.

Question

Question

Cleanup Address

asked on March 2, 2017

From a SQL query, I'm retrieving the 4 components of an address (number, directional, street name, street type).  Afterwards, the values are concatenated with one space added between each component.  The issue is that not all have a directional (i.e., E, W, N, S) which leaves an extra space.  Can this be cleaned up with a regular expression?

 

0 0

Replies

replied on March 2, 2017

How about a simple search for two consecutive spaces, followed by a replacement with a single space?

If not, could you please give an example of what the string looks like originally, and what you would like the corrected string to be? Thanks.

0 0
replied on March 3, 2017

Addresses like '2 E Main St' (good)  or '110  Riverside Dr' (has two spaces, would like replace with one space between street number and street name).

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.