Here's a sample of using field mapping. Not as hard as it looks once you get some practice. block_out = str(sel)+"_blocks"
field_mappings = arcpy.FieldMappings()
field_mappings.addTable(block_lyr)
fldmap_OBJID = arcpy.FieldMap()
fldmap_BLOCKSTAGE = arcpy.FieldMap()
fldmap_AREAGIS = arcpy.FieldMap()
fldmap_OPTYPE = arcpy.FieldMap()
fldmap_BLOCKTYPE = arcpy.FieldMap()
fldmap_HARVSEASON = arcpy.FieldMap()
fldmap_ROADPERCNT = arcpy.FieldMap()
#fldmap_SOURCEID = arcpy.FieldMap(8,"","Join")
fldmap_OBJID.addInputField(block_lyr, "OBJECTID")
fld_OBJID = fldmap_OBJID.outputField
fld_OBJID.name = "O_OID"
fldmap_OBJID.outputField = fld_OBJID
field_mappings.addFieldMap(fldmap_OBJID)
fldmap_BLOCKSTAGE.addInputField(block_lyr, "BLOCKSTAGE")
fld_BLOCKSTAGE = fldmap_BLOCKSTAGE.outputField
fld_BLOCKSTAGE.name = "BLOCKSTAGE"
fldmap_BLOCKSTAGE.outputField = fld_BLOCKSTAGE
field_mappings.addFieldMap(fldmap_BLOCKSTAGE)
fldmap_AREAGIS.addInputField(block_lyr, "AREAGIS")
fld_AREAGIS = fldmap_AREAGIS.outputField
fld_AREAGIS.name = "AREAGIS"
fldmap_AREAGIS.outputField = fld_AREAGIS
field_mappings.addFieldMap(fldmap_AREAGIS)
fldmap_OPTYPE.addInputField(block_lyr, "OPERATIONSTYPE")
fld_OPTYPE = fldmap_OPTYPE.outputField
fld_OPTYPE.name = "OPTYPE"
fldmap_OPTYPE.outputField = fld_OPTYPE
field_mappings.addFieldMap(fldmap_OPTYPE)
fldmap_BLOCKTYPE.addInputField(block_lyr, "BLOCKTYPE")
fld_BLOCKTYPE = fldmap_BLOCKTYPE.outputField
fld_BLOCKTYPE.name = "BLOCKTYPE"
fldmap_BLOCKTYPE.outputField = fld_BLOCKTYPE
field_mappings.addFieldMap(fldmap_BLOCKTYPE)
fldmap_HARVSEASON.addInputField(block_lyr, "HARVESTSEASON")
fld_HARVSEASON = fldmap_HARVSEASON.outputField
fld_HARVSEASON.name = "HARVSEASON"
fldmap_HARVSEASON.outputField = fld_HARVSEASON
field_mappings.addFieldMap(fldmap_HARVSEASON)
fldmap_ROADPERCNT.addInputField(block_lyr, "ROADPERCENTAGE")
fld_ROADPERCNT = fldmap_ROADPERCNT.outputField
fld_ROADPERCNT.name = "ROADPERCNT"
fldmap_ROADPERCNT.outputField = fld_ROADPERCNT
field_mappings.addFieldMap(fldmap_ROADPERCNT)
for selection in blocklist:
if blockPrev <> selection and not arcpy.Exists(block_out+".shp"):
block_query = ("\""+str(block_id)+"\" = \'"+str(selection)+"\' AND (BLOCKSTAGE = 'APPR')")
arcpy.FeatureClassToFeatureClass_conversion(block_lyr, exportdir, block_out, block_query, field_mappings)
Or here is the alternative dropFields = list()
fieldList = arcpy.ListFields(block_out+".shp")
keep_list = ["O_OID","SOURCEID","BLOCKTYPE","ROADPERCNT","BLOCKSTAGE","AREAGIS","OPERATIONS","HARVSEASON","OBJECTID","PLANNEDVOL","OID","Geometry"]
for f in fieldList:
#print f.name
if f.name not in keep_list and f.type not in keep_list:
dropFields.append(f.name)
#print dropFields
arcpy.DeleteField_management(block_out+".shp", dropFields)