Kicking Ass with the Replace function in ArcMap Field Calculator

Time and time again, I find Field Calculator to be one of the most powerful tools available in ArcGIS Desktop and I use it almost every time I manipulate attribute data in ArcMap. “Replace” is one function that I find to be particularly useful and a major boost to my productivity!

You can use “Replace” to perform bulk replace operations for string fields. This can save you lot of typing!

In this example, I change the path for a set of orthophotos in an image catalog, from the C: drive to the D: drive.

To perform this operation;

  1. Open Field calculator by right clicking on the field where you want to change values
  2. use the following syntax in the Field Calculator dialog   

       replace ( [YOUR_FIELD_NAME] , “Old Value”, “New Value”)

          3. Click OK

The syntax for the example below would look like this:

    replace([IMAGE],”C:”,”D:”)

Field Calculator

 For more information on this topic, as well as other useful Field Calculator functions, see the following technical article from ESRI: HowTo: Use VBA functions in the field calculator 

Tags: , , , ,

One Response to “Kicking Ass with the Replace function in ArcMap Field Calculator”

  1. Sev Says:

    this is great but how can you use a wildcard? I have a situation where I need to replace a string in parenthesis with a blank space so I can trim it. any help would be appreciated.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.