AnsweredAssumed Answered

ArcPy Feature Class to Feature Class - Name contains invalid charcters

Question asked by bisoftware on Aug 3, 2018
Latest reply on Aug 6, 2018 by bisoftware


I have a Feature Class to Feature Class script that is supposed to take a Feature Class (FC) of locations and create a separate FC for each location. However, it keeps giving me the following two errors.

ERROR 000210: Cannot create output E:\arcGIS_Shared\Business Analyst\PotentialCitePackages.gdb\NorthEdmond  
ERROR 000354: The name contains invalid characters
Failed to execute (FeatureClassToFeatureClass)

Here is the FC to FC script:

inFeatures = "PythonTest_Geocoded"
fields = ['ObjectID', 'Shape','USER_Center']

with arcpy.da.SearchCursor(inFeatures, fields) as cursor:
    for row in cursor:
        outLocation = r"E:\arcGIS_Shared\Business Analyst\PotentialCitePackages.gdb"
        outFeatureClass = "{0}".format(row[2])
        delimitedField = arcpy.AddFieldDelimiters(env.workspace, "USER_Center")
        expression = delimitedField + " = '{0}'".format(row[2])
        ## Execute FeatureClassToFeatureClass
        arcpy.FeatureClassToFeatureClass_conversion(inFeatures, outLocation, outFeatureClass, expression)

The output FCs are supposed to be named after their corresponding locations ('USER_Center"). This field contains no invalid characters, as you can see below (I was testing this code on a table with only 3 rows).



Could someone help me figure out what I'm doing wrong/missing?