Summary
The instructions provided describe how to remove and replace characters from a field in an attribute table using the Calculate Field tool in ArcGIS Pro. In this example, the hyphens (-) are removed under the Region field of the attribute table, and replaced with a comma (,) for improved readability.
Procedure
- Open the project in ArcGIS Pro.
- Right-click the layer in the Contents pane, and click Attribute Table.
- Click the Calculate Field button to open the Calculate Field geoprocessing tool.
- In the Calculate Field pane, select the field for editing under Field Name (Existing or New). In this example, it is Region. Ensure the Expression Type is Python3.
- Under the Expression section, click the field for editing (in this example, it is Region) from the Fields list. Click .replace() from the Helpers list.
- Within the bracket in .replace(), type "-","," to replace the hyphens with a comma, as shown below.
![FieldName]!.replace("-",", ")
The following demonstrates the proper expression:
!Region!.replace("-",", ")
- Click OK. The tool completes with the hyphens removed and replaced with a comma.
- Click the Save Edits button in the Calculate Field pane to save the changes.