English

How To: Replace one value for another within a field

Summary

Instructions provided demonstrate how to use the Replace function in the Field Calculator to replace one value for another within a field in a table.

The example below uses VBScript. For Python examples, see: Calculate Field examples, Simple calculations

Procedure

  1. Load the table into ArcMap.
  2. Select Start Editing from the Editor menu.
  3. Open the table.
  4. Right-click the desired field.
  5. Select Field Calculator.
  6. Type the following in the expression box:
replace()
  1. Place the cursor between the parenthesis of the line just typed.
  2. Select the name of the field from the Fields list.
  3. Type a comma after the end bracket surrounding the field name.
  4. Type the value to be replaced and the replacement value; enclose each value in quotation marks and separate with a comma. For example:
replace([FLD_name],"Wisconsin","WI")
  1. Click OK.

Related Information