ArcGIS: Concatenating Field Values

A typical task in spatial data maintenance is to concatenate two or more field values into a new field. Examples include unique keys, names, street names (prefix and suffixes), suburb and post codes, and phone numbers.

For the purpose of the kerb and gutter dataset, I need to concatenate road_id with block_id, separated by a colon.

    Field Values

    RoadID 
    1234
    
    BlockID 
    5
    

    New Field

    RoadID_BlockID 
    1234:5
    

The manual workflow was to copy+paste the RoadID into the new field; then insert the colon : and then enter the corresponding BlockID. But I have thousands of these things to do and the tedium was driving me nuts. Out of necessity I began exploring methods to automate this process. A simple VBscript was the answer.

Can't say I mastered programming in 2 hours but it has sped up my efficiency by loading the script instead of doing this manually - which is a WIN today!

The challenge was getting the syntax right without actually knowing how to code in VBscript or Python. So after previewing several example scripts on gisstackexchange.com I wrote my own code through trial and error.

    [ROADID] & ":" & [BLOCKNO]

That's it?

I'll need to investigate how to setup more advanced code in Python to satisfy validation issues. Right now the code assumes that the values in RoadID and BlockID are not null, and I'm selectively running the script as I work on each street under the kerb and gutter dataset. Theoretically I could save time by running the script at the end, but I also need to double check my data entry to ensure that it is consistent with the source file.

Saved as a script and now I can just load it when necessary.

This happens a lot though... the workstation is kind of slow as it tries to process it over the network / ArcServer.




concatenating, field values, arcgis, functions, scripting, vbscript