Any ideas how to break out EU addresses into street & house number? (1 Viewer)

peskywinnets

Registered User.
Local time
Today, 09:02
Joined
Feb 4, 2014
Messages
576
I have a working solution for UK/US addresess, which typically follow this format

123 Station Road

but Germans Italians & Spanish etc reverse things, for example...

Via Trieste 22

...any ideas how I can break out the above to

22 (Property number)
Via Trieste (Street Name)

So, I need to start from the right of the string & locate the first space etc...but it's beyond me!

Many thanks!
 

jdraw

Super Moderator
Staff member
Local time
Today, 04:02
Joined
Jan 23, 2006
Messages
15,385
Hi Pesky,
How about giving us some sample data?
Also, what is the business rule(s) involved?

I country in this list, then "process" the address???

The EU countries are: Austria, Belgium, Bulgaria, Croatia, Republic of Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia, Slovenia, Spain and Sweden.

I did some googling and found this address sampler
 

Micron

AWF VIP
Local time
Today, 04:02
Joined
Oct 20, 2018
Messages
3,478
What comes to mind at the moment is using IsNumeric in a loop that tests each character moving from the right if your current code is catching that the first character is not a number. Then use Left or Mid once the position of the last numeric character is known.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 09:02
Joined
Feb 19, 2013
Messages
16,634
or use the instrRev function to find the last space

PropNumber=mid(address,instrrev(address," ")+1)
Street=left(address,instrrev(address," ")-1)

edit missed the parameters
 

peskywinnets

Registered User.
Local time
Today, 09:02
Joined
Feb 4, 2014
Messages
576
or use the instrRev function to find the last space

PropNumber=mid(address,instrrev(address," ")+1)
Street=left(address,instrrev(address," ")-1)

edit missed the parameters

That worked a treat...thank you soooo much!
 

Minty

AWF VIP
Local time
Today, 09:02
Joined
Jul 26, 2013
Messages
10,371
What comes to mind at the moment is using IsNumeric in a loop that tests each character moving from the right if your current code is catching that the first character is not a number. Then use Left or Mid once the position of the last numeric character is known.
@Micron Be careful with this one, I got caught out;
1588180078701.png


a-f are acceptable as hex numbers... o_O
 

isladogs

MVP / VIP
Local time
Today, 09:02
Joined
Jan 14, 2017
Messages
18,247
I have a working solution for UK/US addresess, which typically follow this format

123 Station Road

but Germans Italians & Spanish etc reverse things, for example...

Via Trieste 22

...any ideas how I can break out the above to

22 (Property number)
Via Trieste (Street Name)

So, I need to start from the right of the string & locate the first space etc...but it's beyond me!

Many thanks!

Having spent a long time developing applications to work with UK postcodes and addresses, I would say there is no such thing as a typical address format. To see many examples that illustrate that comment, see Falsehoods programmers believe about addresses
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:02
Joined
Jul 9, 2003
Messages
16,288
but Germans Italians & Spanish etc reverse things, for example...

Well that's handy to know! I didn't know that... I know that I struggle reading Spanish address when I'm in Barcelona, I could never fathom them out. Simple when you know!
 

Users who are viewing this thread

Top Bottom