Select to view content in your preferred language

Retaining Field Names

427
2
Jump to solution
11-05-2013 12:26 PM
TychoGranville
Frequent Contributor
Just finished the Python web class, and I???m stuck....

I have a Feature Class with a table joined to it.

If I use ArcMap to manually export the FC to a shapefile (TOC --> right-click FC --> Data --> Export Data) I get a new file with the new fields all having the names of the previously joined table fields (so, Owner, Care_Of, etc)

If I use any type of Python command (FeatureClassToFeatureClass_conversion, Project_management, Clip_analysis) in that same MXD the field names change to the name of the table they came from, followed by a number (so, ParcelJo_1, ParcelJo_2, etc)

What command am I missing to keep the original field names?

Thanks,
Tycho
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
T__WayneWhitley
Honored Contributor
If I'm not mistaken you need to use unqualified field names...that's an environment setting, see the sample script in the web help:

Qualified Field Names (Environment setting)
Desktop » Geoprocessing » Environment settings
http://resources.arcgis.com/en/help/main/10.2/index.html#//001w00000008000000


The default value is 'True' so you have to set it to 'False' - here's an excerpt:
import arcpy arcpy.env.qualifiedFieldNames = False


Hope that helps.

Enjoy,
Wayne

View solution in original post

0 Kudos
2 Replies
T__WayneWhitley
Honored Contributor
If I'm not mistaken you need to use unqualified field names...that's an environment setting, see the sample script in the web help:

Qualified Field Names (Environment setting)
Desktop » Geoprocessing » Environment settings
http://resources.arcgis.com/en/help/main/10.2/index.html#//001w00000008000000


The default value is 'True' so you have to set it to 'False' - here's an excerpt:
import arcpy arcpy.env.qualifiedFieldNames = False


Hope that helps.

Enjoy,
Wayne
0 Kudos
TychoGranville
Frequent Contributor
Awesome - that's exactly what  I needed!

Tycho
0 Kudos