1

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

Select by attributes which I have alphabet data.

SELECT ONLY RED INDICATED VALUES

enter image description here

closed as off-topic by Vince, whyzar, PolyGeo Jul 17 at 19:53

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Can it contain whitespaces and special charachters like .,!? and if so do you want to select? Or only letters – BERA Jul 17 at 18:49
  • only letters like A-Z and a-z – rakes reddy posham Jul 17 at 18:52
  • Welcome to GIS SE! As a new user please take the tour – Midavalo Jul 17 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 Jul 17 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 at 18:54
5

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
            oids_to_select.append(oid)

#Select
sql = "{0} IN{1}".format(arcpy.AddFieldDelimiters(layer, oidfield), tuple(oids_to_select))
arcpy.SelectLayerByAttribute(in_layer_or_view=layer, where_clause=sql)

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