Got 11 Tables exported to gdb from excel files.
Those Tables have the same structure (same fields) but different data.
Records from the Tables contain useless data which needs to be deleted in the script process.
In ArcGIS Pro I delete that useless data with the Select by Attributes tool:
Select [Where] [FieldName] [contains the text] [uselesstext]
And then delete the selected records.
But I need to put this process into the script though can not find the proper code or hint to create the function.
import arcpy
fc = r'D:\EXPORT\UPLOAD.gdb\Parcel_r01'
with arcpy.da.UpdateCursor(fc, "owner") as cursor:
for row[0] in cursor:
if row[0] is LIKE regist%:
cursor.deleteRow()
source https://stackoverflow.com/questions/75390958/select-by-attributes-and-delete-selected-records-with-arcpy
Comments
Post a Comment