I am trying to generate 2 variations of an address using the Suffix abbreviation from USPS website.
So lets say I have the address: 1234 Random Street, I want to make sure that I am generating another variation of this address: 1234 Random St. How do I do this?
This is the website I have to use and I am going to have to utilize all the “Primary street suffix name” and “Postal Service Standard Street abbreviation” from this site: C1 Street Suffix Abbreviations | Postal Explorer
No, you can ignore the center column in the website. Here is an example of what I am trying to do:
Lets say I have an address 1234 Random Street. The suffix “Street” can be found on the left column in that website, so I need to be able to run a match for the word “Street” and find a match in the right column resulting in “St”.
Same thing if the address is 1234 Random St. Then I would need to run a match and find the match for the St which is “Street”.
1 First use table extraction to extract whole of the table
2. now use assign and save the output of this which would be Ienumerable of datarow Ienumdr = dt.AsEnumerable.Where(function(x) System.Text.RegularExpressions.Regex.IsMatch(strAddress,"\b" + x("firstColumn").ToString + "\b"))
3. Now use if activity with Ienumdr.Count>0
4. On the then side you can use assign to replace strAddress = strAddress.Replace(Ienumdr(0)("firstColumn").ToString, Ienumdr(0)("thirdColumn").ToString
Repeat steps 2 to 4 on the else side of the 3rd step with thirdcolumn instead of first column
I am not sure, I was thinking of saying it as an array. Also, if the address has something like “Apt 1010” or something in the end, how do you skip over that?
Thank you! I tried this, it worked, but when I tested with an address “1010 Northtown Park Drive”, it updated the word “Park”, and didn’t change the word “Drive” to “Dr”. How do I fix that?