Substituting Partial Text in Attribute Table

481
0
06-30-2020 01:13 PM
PeteJordan
Occasional Contributor III

In ARCmap, if I recall while in editing mode, in the Attribute table one could do a "Search & Replace" for a specific text you may have in a field using the standard Ctrl-H.

  In Arcmap Pro, that doesn't seem to work at all anymore and the way to supposedly do it is to hit the 3 Bars in the top right of the Attribute Table and select the "Find & Replace".  Not sure why, but mine is grayed out and wondering why that is?

  I think you can do it in the Calculate Field under the Code Block, but I keep coming up with a

"WARNING 002858: Certain rows set to NULL due to error while evaluating python expression:   File "<string>", line 3, in replace" error using something simple like this. 

NAME = 

replace (!NAME!)

Code Block

import re
def replace(val):
      return re.sub ( 'TEXT A', 'text b', val)

  I also looked at causes for this and none of these seem to apply from the (Fundamentals of field calculations—ArcGIS Pro | Documentation ) of why the Ctrl-F or Ctrl-H doesn't work.

  The field I have is a text field I can individually edit manually or use Calculate Field to change the data as a whole.  It's not joined, or anything other than just a text field:

  • A field that is managed by ArcGIS cannot be edited manually. Consequently, you cannot calculate field values for the ObjectID (OID or FID) field or the Shape_Length and Shape_Area fields for a geodatabase feature class.
  • The table's data source is read-only, write access can't be established to the folder or geodatabase, or the data source is in a format that can't normally be modified.
  • The field belongs to a table that has been joined to your table. You can only calculate values for fields in the origin table.
  • The field may be a raster, BLOB, or Global ID type, which cannot be calculated.
0 Kudos
0 Replies