AnsweredAssumed Answered

Delete all empty shapefiles in a Folder

Question asked by meethyl on Sep 25, 2014
Latest reply on Sep 25, 2014 by Lila2067

I want to delete all empty shapefiles in a folder. The following is not working:

 

 #Find empty shapefiles and delete them   

arcpy.env.workspace = r"S:\SupportServices\LGAShapefiles" 

shapefiles = arcpy.ListFeatureClasses() 

for shapefile in shapefiles: 

if arcpy.management.GetCount(shapefile)[0]=="0"

     arcpy.Delete_management(shapefile) 

     print shapefile + "Deleted" 

Outcomes