473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Extracting Street Number

Hi,

I'm trying to clean up a large database in Access. I have one field for
address, which needs to be broken up into Street Number, Street Name, and
Street Label (St., Road, etc.)

The problem is that the data is very dirty. So some addresses will be
standard "456 XYZ Road," while others won't have a number and will just say
"XYZ Industrial Park," meaning I can't just use Instr to search for the
first space because sometimes the street number needs to be left blank.
Rather, I need to use a command to cycle the first few characters and tell
if they're numeric or alphabetical, copying them only if they're numeric.
Anyone have any ideas how to do this (i.e. how to tell if they're numeric or
not) or any link that has a little code snippet to do this?

Thanks in advance.
Nov 13 '05 #1
7 2969
Upon closer examination of my data, it appears that there's good news and
bad news. The bad news is that often the street number comes after the
street name, e.g. XYZ Road 3, so I can't just use Val to pick out the first
numerical values from the string, because it will run into the alphabetical
characters first and return a -1.
On the other hand, there are no streets with numbers in them. So I just need
to take all of the numbers in the string (though some may have characters in
the middle, e.g. 13/7, and I want that slash to remain with the numbers) and
store them separately. Any idea how I can do that? How can I pull out just
the part of the string from the first number to the last number?
Thanks again in advance.
"Raphi" <le**@DELETE.THIS.optonline.net> wrote in message
news:ce***********@netnews.upenn.edu...
Hi,

I'm trying to clean up a large database in Access. I have one field for
address, which needs to be broken up into Street Number, Street Name, and
Street Label (St., Road, etc.)

The problem is that the data is very dirty. So some addresses will be
standard "456 XYZ Road," while others won't have a number and will just say "XYZ Industrial Park," meaning I can't just use Instr to search for the
first space because sometimes the street number needs to be left blank.
Rather, I need to use a command to cycle the first few characters and tell
if they're numeric or alphabetical, copying them only if they're numeric.
Anyone have any ideas how to do this (i.e. how to tell if they're numeric or not) or any link that has a little code snippet to do this?

Thanks in advance.

Nov 13 '05 #2
If the 'number substring' contains no embedded spaces, you could scan for
the first numeric char., and the first subsequent space, and take the chars
between as being the street number. I don't know how you can differentiate
the street name and label though. You might have 'Acacia Avenue' or 'The
Poplars'..... And how about named (rather than numbered) addresses?

Dave

"Raphi" <le**@DELETE.THIS.optonline.net> wrote in message
news:ce***********@netnews.upenn.edu...
Upon closer examination of my data, it appears that there's good news and
bad news. The bad news is that often the street number comes after the
street name, e.g. XYZ Road 3, so I can't just use Val to pick out the first numerical values from the string, because it will run into the alphabetical characters first and return a -1.
On the other hand, there are no streets with numbers in them. So I just need to take all of the numbers in the string (though some may have characters in the middle, e.g. 13/7, and I want that slash to remain with the numbers) and store them separately. Any idea how I can do that? How can I pull out just
the part of the string from the first number to the last number?
Thanks again in advance.
"Raphi" <le**@DELETE.THIS.optonline.net> wrote in message
news:ce***********@netnews.upenn.edu...
Hi,

I'm trying to clean up a large database in Access. I have one field for
address, which needs to be broken up into Street Number, Street Name, and Street Label (St., Road, etc.)

The problem is that the data is very dirty. So some addresses will be
standard "456 XYZ Road," while others won't have a number and will just say
"XYZ Industrial Park," meaning I can't just use Instr to search for the
first space because sometimes the street number needs to be left blank.
Rather, I need to use a command to cycle the first few characters and tell if they're numeric or alphabetical, copying them only if they're numeric. Anyone have any ideas how to do this (i.e. how to tell if they're

numeric or
not) or any link that has a little code snippet to do this?

Thanks in advance.


Nov 13 '05 #3
"Raphi" <le**@DELETE.THIS.optonline.net> wrote in
news:ce***********@netnews.upenn.edu:
Hi,

I'm trying to clean up a large database in Access. I have one
field for address, which needs to be broken up into Street
Number, Street Name, and Street Label (St., Road, etc.)

The problem is that the data is very dirty. So some addresses
will be standard "456 XYZ Road," while others won't have a
number and will just say "XYZ Industrial Park," meaning I
can't just use Instr to search for the first space because
sometimes the street number needs to be left blank. Rather, I
need to use a command to cycle the first few characters and
tell if they're numeric or alphabetical, copying them only if
they're numeric. Anyone have any ideas how to do this (i.e.
how to tell if they're numeric or not) or any link that has a
little code snippet to do this?

Thanks in advance.

I can't think of a single valid reason to break up an address field
into street number, street name and street type.

Save yourself a lot of trouble for nothing.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #4
In message <ce***********@netnews.upenn.edu>, Raphi
<le**@DELETE.THIS.optonline.net> writes
Hi,

I'm trying to clean up a large database in Access. I have one field for
address, which needs to be broken up into Street Number, Street Name, and
Street Label (St., Road, etc.)

The problem is that the data is very dirty. So some addresses will be
standard "456 XYZ Road," while others won't have a number and will just say
"XYZ Industrial Park," meaning I can't just use Instr to search for the
first space because sometimes the street number needs to be left blank.
Rather, I need to use a command to cycle the first few characters and tell
if they're numeric or alphabetical, copying them only if they're numeric.
Anyone have any ideas how to do this (i.e. how to tell if they're numeric or
not) or any link that has a little code snippet to do this?


If you need to do this I would consider multi-pass processing with a
flag field to indicate that the address has been processed. Use a
different value in the flag field for each rule that you apply, that way
you can easily reverse out any errors you discover later.

Look for a series of rules that will each process one format of address,
and then set the flag. The obvious one is where the first token in the
address is a numeric group, extract this and set the flag.

Keep a count of the number of unprocessed records and when this reaches
a manageable level switch to manual processing.

Randomly select a number of the automatically processed addresses for
manual checking.

If you intend to mailshot the people on the list make sure that you ask
for address corrections and return of undeliverable mail, at least for
the first mailshot after you use the new addresses. Expect a higher than
normal number of returns.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #5
I will break the street name from the street number if I plan to sort by
street names, or look for addresses close by.
Fred Zuckerman
"Bob Quintal" <rq******@sPAmpatico.ca> wrote in message
news:Xn**********************@66.150.105.49...
I can't think of a single valid reason to break up an address field
into street number, street name and street type.

Save yourself a lot of trouble for nothing.

Nov 13 '05 #6
"Fred Zuckerman" <Zu********@sbcglobal.net> wrote in
news:WG*****************@newssvr27.news.prodigy.co m:
I will break the street name from the street number if I plan
to sort by street names, or look for addresses close by.
Fred Zuckerman
"Bob Quintal" <rq******@sPAmpatico.ca> wrote in message
news:Xn**********************@66.150.105.49...
I can't think of a single valid reason to break up an address
field into street number, street name and street type.

Save yourself a lot of trouble for nothing.

Much better to just use the postal code for that.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #7
Unless you only want 'close' neighbors (about a block)
Postal code would include 1000's of addresses.
Fred

"Bob Quintal" <rq******@sPAmpatico.ca> wrote in message
news:Xn**********************@66.150.105.49...
"Fred Zuckerman" <Zu********@sbcglobal.net> wrote in
news:WG*****************@newssvr27.news.prodigy.co m:
I will break the street name from the street number if I plan
to sort by street names, or look for addresses close by.
Fred Zuckerman
"Bob Quintal" <rq******@sPAmpatico.ca> wrote in message
news:Xn**********************@66.150.105.49...
I can't think of a single valid reason to break up an address
field into street number, street name and street type.
Save yourself a lot of trouble for nothing.


Much better to just use the postal code for that.
Bob Quintal

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sugapablo | last post by:
I have a database table that contains street addresses in the following format: 123 Any St. 456 Some Rd. 7789 That Blvd. etc. I.e. Street number, street name, standard abbriviation of road...
0
by: Ole | last post by:
Good day, perhaps someone is interested in enhancing this regular expression (^((\w+)(\-)?|(\.)?)+((\w+)((\s)+|((\.)(\s)*)))(\d+)) it is meant to filter a string, corresponding to a valid...
1
by: Al Dykes | last post by:
Does anyone have an idea on how to find ZIP+4 codes? Thanks -- a d y k e s @ p a n i x . c o m Don't blame me. I voted for Gore.
2
by: wolftor | last post by:
Does anyone know how to create a query that will separate the street number from the street name? Eg. current address field = 14 Main Street, unit 4 but I want to get: streetno = 14...
4
by: Tom Warren | last post by:
About once a year or so for the last 10 years, I update my street address parser and I'm starting to look at it again. This parser splits a street address line into its smallest common elements...
4
by: Robert Fitzpatrick | last post by:
Thanks to some help here on the list, I've been able to get addresses sorting pretty well, but now I have a issue with same addresses on different streets not grouping the streets. This is what I'm...
6
by: Amma | last post by:
Hello Every one , Pls help me to extracting number from a text file since I am new to perl programming . I have a file and need to extract the number after semicolon in that ...
4
by: Ant | last post by:
Hi all, My kids have a bunch of games that have to be run from CD (on Windows XP). Now they're not very careful with them, and so I have a plan. I've downloaded a utility (Daemon Tools) which...
4
by: HowHow | last post by:
Using Access 2000. I need to group the address by suburb then by street name in my report. Two major problems here: 1. Unit number has the word "Unit" before number 2. Semi detach house has "a"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.