I have two folders with shapefiles: r'E:\SO\Polygons' and r'E:\SO\Districts'
Within each folder I have 215 shapefiles named with similar naming conventions: poly_100 or dist_100. I need to clip the polygons by the districts if their ending digits are equal. I am new to python and at a loss:
#folder for clipped Voronoi polygons Voronoi_file = str(maindir) + "/" + "Voronoi_polygons" if not os.path.exists(Voronio_file): os.makedirs(Voronoi_file) env.workspace = r'E:\SO\Polygons' outputworkspace= Voronoi_file count=0 for fc in arcpy.ListFeatureClasses(): end1 = str(fc[4:]) env.workspace = r'E:\SO\Districs' for fc in arcpy.ListFeatureClasses(): end2 = str(fc[4:]) if end1==end2: out_name = str((outputworkspace) + "/" + "dis_poly" + str(count)) # Assemble the output point name and path arcpy.Clip_analysis(end1, end2, out_name) count = count + 1