Mr Bakker thanks a lot for your time. I ve written this but still doesn't work, either it succeded without results or it raised an error. Is there any difference if the folder i have my shp is named points or Points or Kos etc? Is there any problem with the folder i choose to save the new fc? This is the code for the tool:
import arcpy
import os
from arcpy import env
arcpy.overwriteOutput = True
inWorkspace = arcpy.GetParameterAsText(0)
fcs = arcpy.ListFeatureClasses("ev*", inWorkspace)
# define a output folder, to store the results
out_fldr = arcpy.GetParameterAsText(1)
for fc in fcs:
fields = arcpy.ListFields(fc, "P10*", "Integer")
for fld in fields:
fc_sort = os.path.join(out_fldr, "{0}_{1}.shp".format(os.path.splitext(fc)[0], fld.name))
arcpy.Sort_management(fc, fc_sort, [[fld.name, "ASCENDING"]])
And these are the parameters i defined, i also tried to put outfolder as workspace
but i still get that error:
Traceback (most recent call last):
File "C:\Users\Kos\Desktop\scriptsort.py", line 6, in <module>
fcs = arcpy.ListFeatureClasses("ev*", inWorkspace)
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\__init__.py", line 896, in ListFeatureClasses
return gp.listFeatureClasses(wild_card, feature_type, feature_dataset)
File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\geoprocessing\_base.py", line 314, in listFeatureClasses
self._gp.ListFeatureClasses(*gp_fixargs(args, True)))
RuntimeError: ERROR 999999: Error executing function.
Feature type is invalid