Attempting to delete selected records in a geodatabase. The issue is this geodatabase feature classes stay the same on a weekly basis but the top level geodatabase name changes.
My questions are:
- How can i use python to delete selected records from the feature classes. Similar to SQL ie
delete record = 'abc'? - How can python detect the geodatabase change in name every time it changes without having to modify the script, so it just picks up the feature classes which will keep the same name?
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.CopyRows_management("accident.dbf", "C:/output/accident2.dbf")
arcpy.DeleteRows_management("C:/output/accident2.dbf")
globcould help you determine the GDB filename. In arcpy,ListWorkspacesshould work. https://gis.stackexchange.com/questions/16464/listing-feature-classes-in-multiple-geodatabases-in-folder-using-arcpy – SMiller Nov 13 '19 at 14:52