I have a shapefile British Columbia with postal codes. The attribute table gives the codes with no spaces, eg V6P2A8. I am trying to join a csv file by postal code (the key I am using). My csv file has postal codes with a consistent space, eg V6P 2A8. Naturally the join doesn't work because of that space. How can I either remove the space? Thanks Stephen
This is easy to remedy using Python. If you are in ArcGIS, you can simply use Python in a field calculator to strip the space from the field.
The code would look something like:
which will remove the space in the postal code field. You can also do this in raw Python, but you would have to read in your csv file, make the change, and write a new one.
Alternatively, you could open your csv in Excel and use the Substitute function to replace the space with nothing. For example, to strip the space from a postal code in column A1, you would type