A common task within GIS is geocoding; the process of plotting postcodes within a GIS using an address locator. Cleaning the data for this process requires several steps. The format requires postcodes to be a length of 7 characters. This is easily achieved using the following formula in Excel:
=IF(LEN(A2) = 6,REPLACE(A2,3,1,MID(A2,3,1)&” “),IF(LEN(A2)=7,A2,IF(LEN(A2)=8,SUBSTITUTE(A2,” “,””))))
This works for postcodes of lengths 6,7 and 8. Other lengths can be added but it is rare you would encounter these. Save this as a csv file, ensuring the column has a header.
To get these addresses into GIS, you can either use the address locater created from OS Codepoint data (blog post here) which creates an address locator or download the mmqgis plugin for QGIS and upload the csv file (this method takes longer to complete).
To use ArcMap, right click on the csv in ArcCatalog and select geocode. then select the address locator created. A status box will appear and it is likely that some of the postcodes will either not be recognised or contain incorrect characters (an ‘o’ in place of a ‘0’ and vice versa is a common issue). To rectify, select rematch. Once you are happy,load the layer into ArcMap.