CÓMO

Reemplazar el texto de varios campos de una tabla de atributos usando la herramienta Calculadora de campo (Python)

Last Published: November 1, 2023

Resumen

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.

Procedimiento

  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

Id. de artículo:000025171

Recibir notificaciones y encontrar soluciones a problemas nuevos o comunes

Obtenga respuestas resumidas y soluciones de vídeo de nuestro nuevo chatbot de IA.

Descargar la aplicación de soporte de Esri

Información relacionada

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga