ArcMap

Concatenate Row Values

In a table you can concatenate field values or row values.

Concatenating field values
Learn more about concatenating field values from this blog.

Concatenating row values
Download the script tool from here. This tool is based on a python script that takes an input table, selects a row(s) based on a field value, and concatenates the row values of any other specified field. This tool does not create a new output, but updates the input data.

Example of using Concatenating Row Values tool
Usually, in field sampling data a single point (e.g. the center or the intersection of a quadrant) is linked to an area in the field, and the data recorded for each species (grass/shrubs vegetation) within the quadrant is added as a separate entry linked to the same point as shown below:

This data has multiple records for the same center point  of the quadrants. In such cases, if you want to concatenate the vegetation values for the same quadrant you can run the Concatenate Row Values tool (as shown below):

After concatenating the row values, you don’t need all the multiple points because one point has all the information you need (the All_Vegetation field). The Delete Identical tool can then be used to delete all but one of the multiple points (as shown below):

This workflow is shown below in a simple model:

Since both the tools modify the input, creating a backup copy of the input is strongly recommended.

This entry was posted in Analysis & Geoprocessing. Bookmark the permalink.

Leave a Reply

49 Comments

  1. nadinewazen says:

    Thank you this is a very helpful tool.
    I used it to concatenate values in English and it worked just fine.
    However I am having a problem using it to concatenate values in Arabic.
    I am getting the following error:

    Executing: ConcatenateRowValues22 Union_Munip_Concatenated Union_Na_1 Short_Name VillagesAr “, ”
    Start Time: Mon Apr 02 12:11:14 2012
    Running script ConcatenateRowValues22…
    PYTHON ERRORS:
    Traceback Info:
    File “C:Documents and SettingsNadineMy DocumentsArcGISNW_DB_UN_HabitatConcatenateRowValues10ScriptsConcatenaterowvalueArc.py”, line 106, in
    value = str(lastvalue) + Delimiter + str(value)

    Error Info:
    : ‘ascii’ codec can’t encode characters in position 0-4: ordinal not in range(128)

    ArcPy ERRORS:

    Completed script ConcatenateRowValues22…
    Failed to execute (ConcatenateRowValues22).
    Failed at Mon Apr 02 12:11:15 2012 (Elapsed Time: 1.00 seconds)

    If I got it right the problem is in the fact that Arabic is not encoded in ASCII. Is there a way to modify the script to make it identify it as UTF-8?

    Would appreciate any help i can get,

    Thank you !!

Next Article

Make This Dymaxion Globe Ornament Please

Read this article