<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Basic Join Question in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160483#M12297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to do a basic join between a table and a shapefile in a Python script.&amp;nbsp; When I perform the join with a python script, the resulting shapefile loses all of the field names.&amp;nbsp; The resulting shapefile has fields like this: "census20_1", "census_20_2", etc. instead of the original field names.&amp;nbsp; However, when I do the exact same process within ArcGIS (with the same "Add Join" tool) using point and click, the field names are preserved.&amp;nbsp; Below is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, arcview

Census_Shapefile=r'C:\Desktop\Program_Notes\Python\census2000blockgroups_poly.shp'
table=r'C:\Desktop\Program_Notes\Python\education_attainment_by_gender_age.dbf'
Census_Shapefile_Joined=r'C:\Desktop\Program_Notes\Python\Census_Shapefile_Joined.shp'

arcpy.MakeFeatureLayer_management(Census_Shapefile, "Census_Shapefile")

arcpy.AddJoin_management("Census_Shapefile", "LOGRECNO", table, "LOGRECNO")

arcpy.CopyFeatures_management("Census_Shapefile", Census_Shapefile_Joined)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to perform a join using Python that preserves the field names without using an ArcInfo tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Jun 2011 16:24:41 GMT</pubDate>
    <dc:creator>DavidHattis</dc:creator>
    <dc:date>2011-06-18T16:24:41Z</dc:date>
    <item>
      <title>Basic Join Question</title>
      <link>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160483#M12297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to do a basic join between a table and a shapefile in a Python script.&amp;nbsp; When I perform the join with a python script, the resulting shapefile loses all of the field names.&amp;nbsp; The resulting shapefile has fields like this: "census20_1", "census_20_2", etc. instead of the original field names.&amp;nbsp; However, when I do the exact same process within ArcGIS (with the same "Add Join" tool) using point and click, the field names are preserved.&amp;nbsp; Below is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, arcview

Census_Shapefile=r'C:\Desktop\Program_Notes\Python\census2000blockgroups_poly.shp'
table=r'C:\Desktop\Program_Notes\Python\education_attainment_by_gender_age.dbf'
Census_Shapefile_Joined=r'C:\Desktop\Program_Notes\Python\Census_Shapefile_Joined.shp'

arcpy.MakeFeatureLayer_management(Census_Shapefile, "Census_Shapefile")

arcpy.AddJoin_management("Census_Shapefile", "LOGRECNO", table, "LOGRECNO")

arcpy.CopyFeatures_management("Census_Shapefile", Census_Shapefile_Joined)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to perform a join using Python that preserves the field names without using an ArcInfo tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 16:24:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160483#M12297</guid>
      <dc:creator>DavidHattis</dc:creator>
      <dc:date>2011-06-18T16:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Join Question</title>
      <link>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160484#M12298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;check the "qualified fieldnames" environment setting and its code example to see if this applies to your situation&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000008000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w00000008000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 17:24:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160484#M12298</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-06-18T17:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Join Question</title>
      <link>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160485#M12299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yeah, I just had to set the qualified field names to false, and it worked.&amp;nbsp; Thanks a lot!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jun 2011 19:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/basic-join-question/m-p/160485#M12299</guid>
      <dc:creator>DavidHattis</dc:creator>
      <dc:date>2011-06-19T19:10:40Z</dc:date>
    </item>
  </channel>
</rss>

