HOW TO

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

Last Published: November 1, 2023

Zusammenfassung

An attribute table is a database containing non-spatial information on a set of geographic features in a geographic information system (GIS). The information is arranged so each row represents a feature and each column represents one feature attribute. In ArcGIS Pro, rows are known as records and columns are fields. Each field stores specific types of data, such as numbers, dates, or text.

The instructions provided describe how to use the Replace function in the Field Calculator (Python) tool to replace text in multiple fields within an attribute table without editing each record individually.

Vorgehensweise

  1. In ArcGIS Pro, open the attribute table of the layer.
Screenshot of the feature layer to open the attribute table
  1. In the attribute table, right-click the field heading, and click Calculate Field.
Image of selecting the Calculate Field option
  1. In the Calculate Field window, select the feature layer for Input Table, the field name for Field Name (Existing or New), and Python 3 for Expression Type.
  2. Double-click the field name under Fields, and .replace() under Helpers.
  3. In the expression box, type the value to be replaced, and the replacement value. Enclose each value in quotation marks, and separate them with a comma.
Image of the inputs in the Calculate field dialog box
  1. Click Apply and click OK.
The following image shows the text replaced in the attribute table.
 
Image of the example of the text being replaced in the attribute table

Artikel-ID: 000025171

Benachrichtigungen erhalten und Lösungen für neue oder häufige Probleme finden

Unser neuer KI-Chatbot stellt zusammengefasste Antworten und Videolösungen für Sie bereit.

Esri Support App herunterladen

Zugehörige Informationen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln