I only want to select values that are entirely alphabetic characters.

Select by attributes which I have alphabet data.


enter image description here

  • 2
    Can it contain whitespaces and special charachters like .,!? and if so do you want to select? Or only letters – BERA Jul 17 '19 at 18:49
  • only letters like A-Z and a-z – rakes reddy posham Jul 17 '19 at 18:52
  • Welcome to GIS SE! As a new user please take the tour – Midavalo Jul 17 '19 at 18:53
  • 1
    I'd probably use a cursor for this. Or calculate a new field that matches only the values with alphabetic characters and then select all non-null values – Marcelo Villa-Piñeros Jul 17 '19 at 18:53
  • 2
    @rakesreddyposham please edit your question to include any additional information (rather than commenting). What have you tried? Can you give some examples of your existing data? – Midavalo Jul 17 '19 at 18:54

Use arcpy and check each row of the table using da.SearchCursor and list ObjectIDs of the rows matching your condition. Then select using the list. Adjust and execute in python window:

import arcpy

layer = 'somelayeraddedtothemap' #Change
field_to_check = 'somefield' #Change

oidfield = arcpy.Describe(layer).OIDFieldName #What is the oid fieldname

#List oids of rows with only letters
oids_to_select = []
with arcpy.da.SearchCursor(layer,[oidfield, field_to_check]) as cursor:
    for oid, somestring in cursor:
        if somestring.isalpha(): #isalpha is true only if all char are letters

sql = "{0} IN{1}".format(arcpy.AddFieldDelimiters(layer, oidfield), tuple(oids_to_select))
arcpy.SelectLayerByAttribute(in_layer_or_view=layer, where_clause=sql)
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.