Solved! Go to Solution.
Does anyone have a workaround for me where I can specify multiple wildcards when using "Iterate Feature Classes". I need to search for feature class that have the following tile names within a directory of multiple folder such as 1: 2830* 2: 2831* 3: 2930* and copy the shapfiles (polylines) into a File Geodatabase for futher processing.
Wildcards:
2830*;2831*;2930*
Regards
import arcpy destination = arcpy.GetParameterAsText(0) workspace = arcpy.GetParameterAsText(1) arcpy.env.workspace = workspace cases = ['2830', '2831', '2930'] for fc in arcpy.ListFeatureClasses(): for case in cases: if fc.startswith(case): print 'copy the data'
Does anyone have a workaround for me where I can specify multiple wildcards when using "Iterate Feature Classes". I need to search for feature class that have the following tile names within a directory of multiple folder such as 1: 2830* 2: 2831* 3: 2930* and copy the shapfiles (polylines) into a File Geodatabase for futher processing.
Wildcards:
2830*;2831*;2930*
Regards
import arcpy destination = arcpy.GetParameterAsText(0) workspace = arcpy.GetParameterAsText(1) arcpy.env.workspace = workspace cases = ['2830', '2831', '2930'] for fc in arcpy.ListFeatureClasses(): for case in cases: if fc.startswith(case): print 'copy the data'
your code saved me, very nice