The following explains how to read our optimised version of the postcode Address File or PAF data file. Our optimised version of the PAF data file is easy to word index using which ever SQL server you prefer.
Usually the user enters a Postcode, and is then presented with a list of all Buildings, within the matching Postcode. The user then selects address from that list.
The PAF address is then entered into your web form
Examples Data - 1 record PostcodeTAB{Unique Part of each address for Postcode}Line 1-3 (see below)!Town|County|Postcode||Country|Delivery Point Sufix||Organisation Y/N|MailSort code|Spare field||||
PostcodeTAB{Unique Part of each address for Postcode}Line 1-3 (see below)!Town|County|Postcode||Country|Delivery Point Sufix||Organisation Y/N|MailSort code|Spare field||||
The “Postcode” is stored in your own database field with an index. The rest of the PAF Data line can then be stored in a long text field (ntext). All words can be indexed to provide word search.
The “Spare field” contains additional data which may be of interest. More info
The user enters a postcode. You should then clean the Postcode format before doing the search. See FormatPostCode function contained in code.
Then simply find the address from the first field “Postcode” to then display a list of addresses at that postcode or on word search on PAF Data in second field.
To make the PAF Data file as small as possible, the Full address line first contains a list of Unique address parts, which make up the addresses list for a particular postcode. This is in the section enclosed in the "{}" section, each unique address line delimited by "!".
The section after the "{}" is followed by the common part of the address line:
Composition of PAF data for 1 Postcode {Unique parts of address lines} Common part of address !Town|County|Postcode
{Unique parts of address lines} Common part of address !Town|County|Postcode
All fields are delimited by "|" with a marker “!” before Town. The number of address lines in the unique part varies according to the address structure.
So to produce a list of address at a particular postcode:
Example 1 {Organisation 1|No 1 !Organisation 2|No 2 !}Line 1|Line2|Line 3!Town|County|Postcode …
{Organisation 1|No 1 !Organisation 2|No 2 !}Line 1|Line2|Line 3!Town|County|Postcode …
Displays as:
Organisation 1|No 1 Line 1|Line2|Line 3!Town|County|Postcode Organisation 2|No 2 Line 1|Line2|Line 3!Town|County|Postcode
Example 2 {Organisation 1|Top floor|No 1 !Organisation 2|Basement|No 2 !}Line2|Line 3!Town|County|Postcode
{Organisation 1|Top floor|No 1 !Organisation 2|Basement|No 2 !}Line2|Line 3!Town|County|Postcode
Organisation 1|Top floor|No 1 Line2|Line 3!Town|County|Postcode Organisation 2|Top floor|No 2 Line2|Line 3!Town|County|Postcode
The Example download below contains a VBNET and a C# code example of how to convert the PAF data into an address list for display.
13 Mb Example of Full, Street and PostZon data (Geodate)
See test postcodes for examples
You will receive an e-mail when an update is available for download.
The optimised PAF data file should be easily imported into two database fields, one for Postcode, and the other for the Full Royal Mail Address data, in minutes if using the Microsoft SQL Text import utility.
Please note: In accordance with Royal Mail Terms and Conditions, you must have a valid “Large business Package” license. We only supply this type of PAF data for a “Large business Package” license. Please call for the price of these licenses.