English

How To: Replace the text in multiple fields within an attribute table using the Field Calculator tool

Summary

An attribute table is a database that contains non-spatial information about a set of geographic features in a geographic information system (GIS). The information is arranged so that each row represents a feature and each column represents one feature attribute. In ArcGIS, rows are known as records and columns are fields. Each field stores a specific type of data, such as a number, date, or piece of text.

The instructions provided describe how to use the Replace function in the Field Calculator tool to replace the text in multiple fields within an attribute table without having to edit every record individually.

Procedure

To replace values in an attribute table:

  1. In ArcMap, open the feature class or the shapefile.
  2. Open the attribute table of the layer.
    [O-Image]
  3. Click the Editor menu on the Editor toolbar and select Start Editing.
    [O-Image]
  4. Right-click the desired field heading on the Attribute Table. This is to ensure only the selected field is amended.
  5. Select Field Calculator.
    [O-Image]
  6. In the Field Calculator dialog box, type the following in the expression box:

    Code:
    Replace()

  7. Double-click the field name from the Fields list to enter the name into the expression box.
    [O-Image]
  8. Type the value to be replaced and the replacement value; enclose each value in quotation marks and separate with a comma.
    [O-Image]
  9. Click OK. Notice the changes made onto the selected field.

    Note:
    Replacing a string of text (such as 'Crabapple' with 'Honeylocust') replaces all instances of the string of text with 'Honeylocust'. For example:

    • Crabapple > Honeylocust
    • Crabapple, Beverly > Honeylocust, Beverly
    • Robinson Crabapple > Robinson Honeylocust

    To change only 'Crabapple' fields, use the 'Find and Replace' tool and select Whole Field from the Text Match drop-down menu. Use Knowledge Base article 42497 for more information.

  10. Go to the Editor menu and select Save Edits.
  11. Click the Editor menu again and select Stop Editing.

Related Information