Hello,
I am trying to add data to my ArcPro map that resides in a geodatabase. Thing is, I only want to bring in features whose names end in "...RS75m", but there are many other features that I do not want to bring in.
The following snapshot highlights the particular features I want to add to the map (in red), while I do not want to add the other features. Is there an automated way to select based on a wildcard of a features name, or Python console option inside ArcMap?
Solved! Go to Solution.
Try the following in the interactive Python window when you have the map open you want the layers in:
import os
gdb = # set path to geodatabase containing feature classes
walk = arcpy.da.Walk(gdb)
for root, dirs, files in walk:
for fc in files:
if fc.endswith("_RS75m"):
arcpy.MakeFeatureLayer_management(os.path.join(root,fc))
Try the following in the interactive Python window when you have the map open you want the layers in:
import os
gdb = # set path to geodatabase containing feature classes
walk = arcpy.da.Walk(gdb)
for root, dirs, files in walk:
for fc in files:
if fc.endswith("_RS75m"):
arcpy.MakeFeatureLayer_management(os.path.join(root,fc))