473,387 Members | 1,394 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,387 software developers and data experts.

put space between number and letter

I have an address field of 60000+ that I am trying to clean. One thing
I am trying to do is take every apartment number and make it more
standard. Here is my question:

How do I take a record like "NORTHGATE APT5C" and another record like
"NORTHGATE APT5C WESTWOOD AVE" and make them look like:

"NORTHGATE APT 5C" and "NORTHGATE APT5 C WESTWOOD AVE"

I have many different examples, and they don't all have Apt in them. I
figured out how to find them all, using:

Like "*#[a-z]* or Like "*[a-z]#*"

but I don't know how to add a space between them. this is basically an
advanced find/replace, and I'm pretty sure I can do it, but I'm not
sure how to create the update query.

Thanks,
Michael

Apr 23 '07 #1
4 4552
Hi Michael,

Try something like this: Copy a subset of your data to a local table.
Without knowing all the details of your data I am only offering a
general solution/idea that you can experiment with.
UPDATE tblSampleSet SET Address = Replace(Address,"Apt", "Apt ");

What this will do is to take every Address field in your dataset and if
the row field contains Aptxx that value will be replaced with Apt xx.
If this works on your test table, then you can apply it to your main
table.

hth

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Apr 23 '07 #2
On Apr 23, 12:50 pm, Rich P <rpng...@aol.comwrote:
Hi Michael,

Try something like this: Copy a subset of your data to a local table.
Without knowing all the details of your data I am only offering a
general solution/idea that you can experiment with.

UPDATE tblSampleSet SET Address = Replace(Address,"Apt", "Apt ");

What this will do is to take every Address field in your dataset and if
the row field contains Aptxx that value will be replaced with Apt xx.
If this works on your test table, then you can apply it to your main
table.

hth

Rich

*** Sent via Developersdexhttp://www.developersdex.com***
Thanks Rich. I was hoping for a more wide-sweeping solution, but this
will work well for most of the situations.

Apr 23 '07 #3
Do you really want the apartment number formatted differently if it is
followed by a street name, or was that a typo? In my experience, a street
name is normally preceded by a number -- is that not the case with your
addresses? Is it the case with _some_ of them? If there is an apartment
number, is it always in the form APTnX where n is a number and X is
alphabetic? Can n be more than one digit? Can X be more than one letter?

And given that you give only two examples, in which the only reformatting
appears to be of the representation of the apartment number, then refer to
many other examples, some of which do not have an apartment number, it is
very difficult for me to understand exactly what it is that you want to
accomplish. Could you clarify? If you can, perhaps someone can make a
useful suggestion.

The problem most of us have with trying to standardize addresses is that
real-world addresses are not "standard" -- they come in many forms, with
variations that are acceptable in many uses (e.g., delivering letters or
packages). What often results is a long list of conditions to determine the
original format, and a long set of special cases to re-format them.

Larry Linson
Microsoft Access MVP
<mi*************@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
>I have an address field of 60000+ that I am trying to clean. One thing
I am trying to do is take every apartment number and make it more
standard. Here is my question:

How do I take a record like "NORTHGATE APT5C" and another record like
"NORTHGATE APT5C WESTWOOD AVE" and make them look like:

"NORTHGATE APT 5C" and "NORTHGATE APT5 C WESTWOOD AVE"

I have many different examples, and they don't all have Apt in them. I
figured out how to find them all, using:

Like "*#[a-z]* or Like "*[a-z]#*"

but I don't know how to add a space between them. this is basically an
advanced find/replace, and I'm pretty sure I can do it, but I'm not
sure how to create the update query.

Thanks,
Michael

Apr 23 '07 #4
On Apr 23, 4:23 pm, "Larry Linson" <boun...@localhost.notwrote:
Do you really want the apartment number formatted differently if it is
followed by a street name, or was that a typo? In my experience, a street
name is normally preceded by a number -- is that not the case with your
addresses? Is it the case with _some_ of them? If there is an apartment
number, is it always in the form APTnX where n is a number and X is
alphabetic? Can n be more than one digit? Can X be more than one letter?

And given that you give only two examples, in which the only reformatting
appears to be of the representation of the apartment number, then refer to
many other examples, some of which do not have an apartment number, it is
very difficult for me to understand exactly what it is that you want to
accomplish. Could you clarify? If you can, perhaps someone can make a
useful suggestion.

The problem most of us have with trying to standardize addresses is that
real-world addresses are not "standard" -- they come in many forms, with
variations that are acceptable in many uses (e.g., delivering letters or
packages). What often results is a long list of conditions to determine the
original format, and a long set of special cases to re-format them.

Larry Linson
Microsoft Access MVP

<michael.bouc...@gmail.comwrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
I have an address field of 60000+ that I am trying to clean. One thing
I am trying to do is take every apartment number and make it more
standard. Here is my question:
How do I take a record like "NORTHGATE APT5C" and another record like
"NORTHGATE APT5C WESTWOOD AVE" and make them look like:
"NORTHGATE APT 5C" and "NORTHGATE APT5 C WESTWOOD AVE"
I have many different examples, and they don't all have Apt in them. I
figured out how to find them all, using:
Like "*#[a-z]* or Like "*[a-z]#*"
but I don't know how to add a space between them. this is basically an
advanced find/replace, and I'm pretty sure I can do it, but I'm not
sure how to create the update query.
Thanks,
Michael
Thanks for your help. I was afraid it would take many conditions, but
I guess that is what I have to do.

First, it was a typo in my original post, but unfortunately for all
the addresses, there are many different formats, from various
organizations. I am trying to match addresses across these
organizations, and I'd like to be able to map it as well. Hence the
desire to standardize these records.

I was very excited when I was able to identify all of the entries that
contained numbers and letters next each other without spaces simply
putting [a-z]# using Ctr-F. It was able to highlight exactly what I
wanted to locate, but I couldn't replicate that in the query box. If I
can mimic the Ctr-F function and copy and paste each value it
highlights into another field, would be able to fix it decently well.

Basically, I want to separate all the numbers and letters that placed
together without spaces. If you want more detail, let me know.

Thanks,
Michael

Apr 24 '07 #5

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

Similar topics

2
by: barb28 | last post by:
Hello, sometimes I have noticed that in web addresses, the number: 20% will show up in the address. I think this is somehow related to a 'blank space', but am unsure, does anyone know about...
2
by: trint | last post by:
I need to know if this string, which will always vary is a letter or a number value AND if it is a letter, to only get the number, which is obviously 7000: string prodID = "us7000"; is Parse,...
13
by: QQ | last post by:
for instance, I read a char from the input and I need to decide whether it is a letter or a number What I am doing is char a; ...... // read a int true = false; if( (a >='0') && (a <='z') true...
10
by: QQ | last post by:
for instance, I read a char from the input and I need to decide whether it is a letter or a number What I am doing is char a; ...... // read a int true = false; if(( (a >='0') && (a <='9')) | |...
0
by: tshad | last post by:
I have the following textbox and 3 validators. For some reason the message "A Password is required!" is displayed with a couple of spaces in front of it. My other validators don't seem to do...
0
by: Michael Sparks | last post by:
Hello, I'd like to invite you to our first Kamaelia Open Space event. Our theme is "Making Software like Lego through intuitive useful concurrency". Perhaps you want to learn to use...
1
by: thermate | last post by:
diapers, wig, knife ... guys i am dying of laughter, someone help me ... Seems like the Neoconish spirit of Bush/Cheney has permeated the whole country thru the cell phones and cause the yanks...
3
by: pradeep | last post by:
Hi How i check alphnumeric & space validation for input text ? e.g. input : "abc GNM 2" is valid & input : "abc GNM %2" is invalid guide me.
2
by: gazz | last post by:
Hi, Please could someone shed some light on this as I am really struggling to understand how to do this. Given a word entered into a window.prompt EG "forum", how do I create a script to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.