简体   繁体   中英

Address data extraction from text via asp.net (vb.net)

I have address data that is surrounded by random text. Is there a way to extract this data either with a call to a web service or some vb.net function?

example: 1111 S WILSON ROAD APT B8 CITY STATE 55555 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

If your random data is always 0's, try doing a string.Replace to get rid of the 0's and then a Trim() to get rid of extra spaces. You could also use Regex to accomplish the same task to get rid of 0's.

If your random data is truly random, is there a way you can introduce some delimiters in at the beginning and end of your address? For instance, you could have:

#1111 S WILSON ROAD APT B8 CITY STATE 55555# 0 0 0 0 0 0 0 0 0 0 0 0 

This way, you could the SubString function to extract just the data you need using those special characters as delimiters.

-D

from your example it looks like your data is delimited with 4 numbers in the beginning and 5 numbers in the end so you can use regex as

\d{4}(?<Address>.*)\d{5}

and look for Address group name in match

Thanks guys for the responses.. I was not fully informed of the test data (.. of course). What I ended up doing was tossing the text over to the Yahoo PlaceFinder API. If it did not return an exact match, I was alert the user and set the address as best I could. Again thanks for your help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM