<?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 Python: Join Table to Shapefile and export it to GDB in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581937#M45595</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;BR /&gt;I have many tables which I need to join to a Shapefile. Each table has to be joined to the shapefile seperately and then must be exported into a file GDB. &lt;BR /&gt;Anyone knows how to do so with python? Is there a way that the code runs automatically through each table in the folder and joins it to the shapefile, exports it as FC in the GDB, gives it the file name of the table, then removes the join and joins the next table to the same shapefile? I work with ArcGIS 10.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across this site &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000008000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000008000000"&gt;ArcGIS Help 10.1&lt;/A&gt; and also &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000065000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000065000000"&gt;ArcGIS Help 10.1&lt;/A&gt;&amp;nbsp; but I have no clue how to get started to be honest..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 08:35:41 GMT</pubDate>
    <dc:creator>PV</dc:creator>
    <dc:date>2015-05-21T08:35:41Z</dc:date>
    <item>
      <title>Python: Join Table to Shapefile and export it to GDB</title>
      <link>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581937#M45595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;BR /&gt;I have many tables which I need to join to a Shapefile. Each table has to be joined to the shapefile seperately and then must be exported into a file GDB. &lt;BR /&gt;Anyone knows how to do so with python? Is there a way that the code runs automatically through each table in the folder and joins it to the shapefile, exports it as FC in the GDB, gives it the file name of the table, then removes the join and joins the next table to the same shapefile? I work with ArcGIS 10.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I came across this site &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000008000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000008000000"&gt;ArcGIS Help 10.1&lt;/A&gt; and also &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000065000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000065000000"&gt;ArcGIS Help 10.1&lt;/A&gt;&amp;nbsp; but I have no clue how to get started to be honest..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 08:35:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581937#M45595</guid>
      <dc:creator>PV</dc:creator>
      <dc:date>2015-05-21T08:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Join Table to Shapefile and export it to GDB</title>
      <link>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581938#M45596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi P V,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example on how you could do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.overwriteOutput = 1
env.workspace = r"C:\temp\tables"

shapefile = r"C:\data\parcels.shp"

#loopo through tables in C:\temp\tables
for table in arcpy.ListTables("*"):
&amp;nbsp; #Create a new feature layer, this will remove previous join
&amp;nbsp; arcpy.MakeFeatureLayer_management(shapefile, "parcelLyr")

&amp;nbsp; #Join table to feature layer
&amp;nbsp; arcpy.AddJoin_management("parcelLyr", "PIN", table, "PIN")

&amp;nbsp; #Retrieve table name
&amp;nbsp; tableName = table.split(".")[0]

&amp;nbsp; #Export joined layer to new feature clas
&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion("parcelLyr", r"C:\data\ParcelData.gdb", tableName)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581938#M45596</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T01:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Join Table to Shapefile and export it to GDB</title>
      <link>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581939#M45597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you a lot! This code worked PERFECTLY!!! &lt;BR /&gt;I only added this line to it: env.qualifiedFieldNames = False&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 02:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-join-table-to-shapefile-and-export-it-to/m-p/581939#M45597</guid>
      <dc:creator>PV</dc:creator>
      <dc:date>2015-05-22T02:56:42Z</dc:date>
    </item>
  </channel>
</rss>

