Summary
The following instructions demonstrate how to use the Replace function in the Field Calculator tool to replace one value for another within a field in a table.
The example below uses a VBScript string function. For examples using a Python string function, refer to ArcMap: Simple calculations.
Procedure
- Add the table to ArcMap.
- Select Start Editing from the Editor menu.
- Open the table.
- Right-click the desired field heading in the table, and select Field Calculator.
- In the Field Calculator window, type the following function in the expression box:
replace()
- Place the cursor between the parentheses of the typed line.
- Double-click the name of the field from the Fields list to select it.
- Type a comma after the end bracket of the field name.
- Type the value to be replaced and the replacement value, and enclose each value in quotation marks and separate them with a comma. For example to replace the 'Wisconsin' value with the 'WI' value:
replace([FLD_name],"Wisconsin","WI")
- Click OK.