James Silverton wrote:
> There has been some discussion in m.p.excel.misc about parsing the
> irregular length British post codes for use in a spread sheet. The
> problem was solved by an expert (not me!) but I got interested and went
> to the source and obtained this from the official web-page.
>
>
> http://www.royalmail.com/portal/rm/content1?catId=400120&mediaId=9200078
>
>
>
> """"
>
> EC 1V 9 HQ
>
>
>
> The first one or two letters is the postcode area and it identifies the
> main Royal Mail sorting office which will process the mail. In this case
> EC would go to the Mount Pleasant sorting office in London.
>
>
>
> The second part is usually just one or two numbers but for some parts of
> London it can be a number and a letter. This is the postcode district
> and tells the sorting office which delivery office the mail should go to.
>
>
>
> This third part is the sector and is usually just one number. This tells
> the delivery office which local area or neighbourhood the mail should go
> to.
>
>
>
> The final part of the postcode is the unit code which is always two
> letters. This identifies a group of up to 80 addresses and tells the
> delivery office which postal route (or walk) will deliver the item.
>
> """""
>
>
>
> The real kicker is the third part, which is stated to be “usually just
> one number” but I think parsing, as in the solution referred to, could
> be complicated if it is not. I wonder what the Post Office actually does
> in the UK? It might be easier if the post code was actually written with
> spaces as in the example above but normally only two groups are present.
> Do they use bar codes like in the US? The UK system may be very logical
> but, without bar codes, seems not too computer oriented. I do put the
> codes on letters to Britain and I believe I was brought up in Postal
> Code PA34 5TG :-) but I now live at ZIP code 20854-4226-09! Tho' I can
> remember my whole ZIP code, very few know the last two digits and they
> are seldom used except perhaps by the Post Office.
>
>
>
> James Silverton
> Potomac, Maryland
>
> E-mail, with obvious alterations:
> not.jim.silverton.at.comcast.not
The parsing problem is in the interaction of parts 2 & 3. If there are
3 numbers are they xxy or xyy? If there is some interaction defining
the number distribution then it should be possible. For example is
MK452UA in Ampthill MK 45 2 UA or is it MK 4 52 UA?
I suppose the expert had inside knowledge that helped.
|