I am trying to use the Featureclass to Featureclass conversion tool to make a copy of an existing layer (in a geodatabase). My primary motive is to copy over only a few (2 out of 18) fields to the new feature class. I have put a simple script to do this, but this copies all the fields even tough I specify the field names that should be copied.
Can someone please let me know what am i doing wrong.
I want the output feature class (Test) to have two fields A and B.
# Import arcpy module import arcpy # Local variables: Input = "C:\\Work\\Projects\\0a_IL_Naperville\\Segmenter_v8\\1 00001 IL Naperville 2013.gdb\\Streets" Out_location = "C:\\Work\\Projects\\0a_IL_Naperville\\Segmenter_v8\\1 00001 IL Naperville 2013.gdb" keep = ['ST_NAME','FUNC_CLASS','Shape_Length','OBJECTID','Shape','A'] arcpy.FeatureClassToFeatureClass_conversion(Input,Out_location, "Test",field_mapping=keep)