HOW TO

Replace the text in multiple fields in an attribute table using the Field Calculator tool

Last Published: February 11, 2021

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.

Note: 
Support for Visual Basic for Applications (VBA) for ArcMap and ArcCatalog ended with the ArcGIS 10.2.2 release, and Esri has not included VBA compatibility setups since version 10.5. See: ArcGIS Desktop and VBA Moving Forward

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]
  1. Click the Editor menu on the Editor toolbar and select Start Editing.
[O-Image]
  1. Right-click the desired field heading on the Attribute Table. This is to ensure only the selected field is amended.
  2. Select Field Calculator.
[O-Image]
  1. In the Field Calculator dialog box, type the following in the expression box:
Replace()
  1. Double-click the field name from the Fields list to enter the name into the expression box.
[O-Image]
  1. Type the value to be replaced and the replacement value; enclose each value in quotation marks and separate with a comma.
[O-Image]
  1. Click OK. Review 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.
  1. Go to the Editor menu and select Save Edits.
  2. Click the Editor menu again and select Stop Editing.

Article ID: 000012062

Software:
  • ArcMap 10 0
  • ArcMap 10 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options