The following script produces the ERROR 000210: Cannot create output... .shp and ERROR 000354: The name containts invalic characters Failed to execute (Select.).
The line with arcpy.Select_analysis is causing the problem
The result should be shapefiles with the SAME NAME as the Input, but in the Output-Workspace-Folder!
Is there a problem with the path or would you have another idea?
import arcpy, os, math
from arcpy.sa import*
arcpy.CheckOutExtension("Spatial")
pathworkspace = r"D:\aprettylongpath\InputWithShapefilesInside"
outputworkspace = r"D:\aprettylongpath\OutputStillEmpty"
arcpy.env.workspace = pathworkspace
mylist = arcpy.ListFeatureClasses()
where_clause = '"GRIDCODE" =2'
for z in mylist:
print "Shapefile..."+z
inShapefiles = z
arcpy.Select_analysis(inShapefiles,os.path.join(outputworkspace,z),where_clause)
The result from the print in the 3rd last line is:
Shapefile...1111111-rgbi-10cm_compband.shp