Delete empty Feature Classes from GDB

4867
2
Jump to solution
04-09-2015 01:17 PM
ThomasWhite4
New Contributor II

Hello,

I have many feature classes in multiple gdbs that have empty feature classes. Is there anyway to automate a process to look through each .gdb, find the empty feature classes, and to delete the empty feature classes from the .gdb?

Thank you for your time all!

Regards,

Tom

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Probably the easiest way to do this, would be to use some python coding. You may want to move this thread to the Python space. Please remove any duplicate posts of this question.

You can loop through all the workspaces based on a list of gdb's or recursively loop (walk) through folders. Read the content (list featureclasses) and for each featureclass do a count on the features and delete those with 0 features.

View solution in original post

2 Replies
XanderBakker
Esri Esteemed Contributor

Probably the easiest way to do this, would be to use some python coding. You may want to move this thread to the Python space. Please remove any duplicate posts of this question.

You can loop through all the workspaces based on a list of gdb's or recursively loop (walk) through folders. Read the content (list featureclasses) and for each featureclass do a count on the features and delete those with 0 features.

ThomasWhite4
New Contributor II

Thank you for the guidance and redirection!

0 Kudos