Instrução

Substituir o texto em vários campos em uma tabela de atributos usando a ferramenta Calculadora de Campo (Python)

Last Published: November 1, 2023

Resumo

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.

Procedimento

  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 do Artigo: 000025171

Receba notificações e encontre soluções para problemas novos ou comuns

Obtenha respostas resumidas e soluções de vídeo do nosso novo chatbot de IA.

Baixe o Aplicativo de Suporte da Esri

Informações Relacionadas

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download