How To: Remove and replace characters from a field in an attribute table
The instructions provided describe how to remove and replace characters from a field in an attribute table using the Field Calculator in ArcMap. In this example, the hyphen character ( - ) is replaced and removed from a field to provide better readability.
- Open ArcMap.
- Right-click the selected layer in the Table Of Contents, and select Open Attribute Table.
- Start an edit session via the Editor toolbar for the selected layer.
- Right-click the field, and select Field Calculator.
- In the Field Calculator, click the Python parser, and double-click the desired field name to insert the field name in the codeblock. Click the String radio button, and in the Functions list, click .replace().
Within the bracket in .replace(), type "-"," " to replace hyphens with a space.
- Click OK. The hyphens are removed.
- In the Editor toolbar, select Stop Editing and Save Edits to keep the changes.
- ArcGIS Help: Calculate Field examples
- HowTo: Replace the text in multiple fields within an attribute table using the Field Calculator tool
- HowTo: Replace the text in multiple fields within an attribute table using the Find and Replace tool