<?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 Re: Using Python to replicate the Export Data command in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60140#M4781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably using a Shapefile as the intermediate format is not the best choice... Have a look a the example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a featureclass in a fgdb called "Building_lines" with the following field names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("Building_lines"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;OBJECTID
Shape
LEFT_FID
RIGHT_FID
Shape_Length
Left_Height
Right_Height
Left_Parcel
Right_Parcel
Height_dif
Wall_Surface
Wall_Situation
Final_Parcel&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I create a join in the session of ArcMap to another featureclass called "Building_height_sel" and list the fields again, it will show the joined fields too identified by the featureclass name prefix. If I list the fields again it will show:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("Building_lines"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Building_lines.OBJECTID
Building_lines.Shape
Building_lines.LEFT_FID
Building_lines.RIGHT_FID
Building_lines.Shape_Length
Building_lines.Left_Height
Building_lines.Right_Height
Building_lines.Left_Parcel
Building_lines.Right_Parcel
Building_lines.Height_dif
Building_lines.Wall_Surface
Building_lines.Wall_Situation
Building_lines.Final_Parcel
Building_height_sel.OBJECTID_1
Building_height_sel.OBJECTID
Building_height_sel.HEIGHT
Building_height_sel.Shape_Length
Building_height_sel.Shape_Area
Building_height_sel.BuildingID&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;​ mentioned you can use the Copy Features tool to export the result and it will honor the joined fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.CopyFeatures_management("Building_lines", r'D:\Temp\test.shp')
&amp;lt;Result 'D:\\Temp\\test.shp'&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Listing the fields of this result:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("D:\\Temp\\test.shp"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will reveal this beautiful list of (not very useful) field names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FID
Shape
Building_l
Building_1
Building_2
Building_3
Building_4
Building_5
Building_6
Building_7
Building_8
Building_9
Buildin_10
Building_h
Buildin_11
Buildin_12
Buildin_13
Buildin_14
Buildin_15&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you copy the features to a featureclass in a file geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.CopyFeatures_management("Building_lines", r'D:\Temp\Test.gdb\test')
&amp;lt;Result 'D:\\Temp\\Test.gdb\\test'&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... and list the fields of the result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("D:\\Temp\\Test.gdb\\test"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will have more useful names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;OBJECTID
Shape
Building_lines_LEFT_FID
Building_lines_RIGHT_FID
Building_lines_Left_Height
Building_lines_Right_Height
Building_lines_Left_Parcel
Building_lines_Right_Parcel
Building_lines_Height_dif
Building_lines_Wall_Surface
Building_lines_Wall_Situation
Building_lines_Final_Parcel
Building_height_sel_OBJECTID_1
Building_height_sel_OBJECTID
Building_height_sel_HEIGHT
Building_height_sel_BuildingID
Shape_Length&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:17:29 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2021-12-10T22:17:29Z</dc:date>
    <item>
      <title>Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60132#M4773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Complete newbie here looking for some assistance. I need to convert a shapefile into a KML file and as i do this often was looking at Python to automate it. The shapefile has a join to another database to keep it dynamic so i am having to use the "export data" to make a shapefile which i then amend the field name (alias's) and convert to KML. I have tried the featureclasstofeatureclass_conversion command but this renames the fieldnames? I have then tried makefeaturelayermanagement command but this doesnt bring across the joined fields?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 12:53:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60132#M4773</guid>
      <dc:creator>philbennison</dc:creator>
      <dc:date>2016-05-24T12:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60133#M4774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/copy-features.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/copy-features.htm"&gt;Copy Features—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-class-to-feature-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-class-to-feature-class.htm"&gt;Feature Class to Feature Class—Help | ArcGIS for Desktop&lt;/A&gt; but look again at (fixed link I hope)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but you can control field mapping with the options in FC2FC&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldmappings.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldmappings.htm"&gt;FieldMappings—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 13:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60133#M4774</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-24T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60134#M4775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did try to use the help before asking but to be honest as my first bit of python code, it was a bit above me &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 14:54:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60134#M4775</guid>
      <dc:creator>philbennison</dc:creator>
      <dc:date>2016-05-24T14:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60135#M4776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you get stuck, it is easier to comment on your code, so feel free to post it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 15:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60135#M4776</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-24T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60136#M4777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried doing these steps in model builder. If you are new to python it may be simpler to work out the process in model builder then ease into python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/what-is-modelbuilder.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/what-is-modelbuilder.htm"&gt;What is ModelBuilder?—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-join.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/add-join.htm"&gt;Add Join—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;FC2FC that Dan mentions&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/layer-to-kml.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/layer-to-kml.htm"&gt;Layer To KML—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 15:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60136#M4777</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-05-24T15:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60137#M4778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, your &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-class-to-feature-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-class-to-feature-class.htm"&gt;Feature Class to Feature Class—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&amp;nbsp; is a bad link.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 15:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60137#M4778</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-24T15:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60138#M4779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, don't overlook getting it to work "manually" thru the tool, then open the Tools-Geoprocessing-Python window, find the successful tool and "copy as snippet" or just "save" it to a file.&amp;nbsp; That helps in seeing how the command have it laid out, and it's then relatively easy to convert this to a python script/tool.&amp;nbsp; In any case, as Dan mentioned, it would give others a look at what you are trying to do, which make help with more direct feedback.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 15:24:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60138#M4779</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-24T15:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60139#M4780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I worked earlier... geonet is burping again... I will check later&lt;/P&gt;&lt;P&gt;in text form with gaps...&amp;nbsp;&amp;nbsp; http:&amp;nbsp; //&amp;nbsp; desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/feature-class-to-feature-class. htm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 15:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60139#M4780</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-24T15:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60140#M4781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably using a Shapefile as the intermediate format is not the best choice... Have a look a the example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a featureclass in a fgdb called "Building_lines" with the following field names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("Building_lines"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;OBJECTID
Shape
LEFT_FID
RIGHT_FID
Shape_Length
Left_Height
Right_Height
Left_Parcel
Right_Parcel
Height_dif
Wall_Surface
Wall_Situation
Final_Parcel&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I create a join in the session of ArcMap to another featureclass called "Building_height_sel" and list the fields again, it will show the joined fields too identified by the featureclass name prefix. If I list the fields again it will show:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("Building_lines"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Building_lines.OBJECTID
Building_lines.Shape
Building_lines.LEFT_FID
Building_lines.RIGHT_FID
Building_lines.Shape_Length
Building_lines.Left_Height
Building_lines.Right_Height
Building_lines.Left_Parcel
Building_lines.Right_Parcel
Building_lines.Height_dif
Building_lines.Wall_Surface
Building_lines.Wall_Situation
Building_lines.Final_Parcel
Building_height_sel.OBJECTID_1
Building_height_sel.OBJECTID
Building_height_sel.HEIGHT
Building_height_sel.Shape_Length
Building_height_sel.Shape_Area
Building_height_sel.BuildingID&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;​ mentioned you can use the Copy Features tool to export the result and it will honor the joined fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.CopyFeatures_management("Building_lines", r'D:\Temp\test.shp')
&amp;lt;Result 'D:\\Temp\\test.shp'&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Listing the fields of this result:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("D:\\Temp\\test.shp"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will reveal this beautiful list of (not very useful) field names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FID
Shape
Building_l
Building_1
Building_2
Building_3
Building_4
Building_5
Building_6
Building_7
Building_8
Building_9
Buildin_10
Building_h
Buildin_11
Buildin_12
Buildin_13
Buildin_14
Buildin_15&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you copy the features to a featureclass in a file geodatabase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.CopyFeatures_management("Building_lines", r'D:\Temp\Test.gdb\test')
&amp;lt;Result 'D:\\Temp\\Test.gdb\\test'&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... and list the fields of the result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; for fld in arcpy.ListFields("D:\\Temp\\Test.gdb\\test"):
...&amp;nbsp;&amp;nbsp;&amp;nbsp; print fld.name&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will have more useful names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;OBJECTID
Shape
Building_lines_LEFT_FID
Building_lines_RIGHT_FID
Building_lines_Left_Height
Building_lines_Right_Height
Building_lines_Left_Parcel
Building_lines_Right_Parcel
Building_lines_Height_dif
Building_lines_Wall_Surface
Building_lines_Wall_Situation
Building_lines_Final_Parcel
Building_height_sel_OBJECTID_1
Building_height_sel_OBJECTID
Building_height_sel_HEIGHT
Building_height_sel_BuildingID
Shape_Length&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:17:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60140#M4781</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T22:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60141#M4782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rebecca,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if don't have a badly installed copy or am just missing stuff. &lt;/P&gt;&lt;P&gt;I Don't have a tool menu. I have a geoprocessing menu and a python window but when i open this it is blank (This is where i have been entering my code)&lt;/P&gt;&lt;P&gt;If there is a feature when i can copy the code that has been generated by my manual operations that would be awesome&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did i mention that i am very new to Python and fairly new to arcGIS &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 16:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60141#M4782</guid>
      <dc:creator>philbennison</dc:creator>
      <dc:date>2016-05-24T16:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60142#M4783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you comprehensive response. I have tried what you suggested but i am still coming up with errors&lt;/P&gt;&lt;P&gt;It is coming up with &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Runtime error&amp;nbsp; Traceback (most recent call last):&amp;nbsp;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;&amp;nbsp;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 2335, in CopyFeatures&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e ExecuteError: ERROR 000210: Cannot create output C:\Users\Phiben\Documents\ArcGIS&lt;/TD&gt;&lt;TD&gt;esti.shp Failed to execute (CopyFeatures).&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; I really am starting to feel out of my depth !&lt;/P&gt;&lt;P&gt;btw what tool have you used to run your code. &lt;/P&gt;&lt;P&gt;I am just using the python window&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 16:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60142#M4783</guid>
      <dc:creator>philbennison</dc:creator>
      <dc:date>2016-05-24T16:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60143#M4784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have just taken bits from archelp so its probably all wrong&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;arcpy.env.workspace="C:\Users\ME\Docume~1\ArcGIS\Default.gdb"&lt;/P&gt;&lt;P&gt;arcpy.SelectLayerByAttribute_management ("Areamap","NEW_SELECTION"," [Type_Of_area] = 'busy')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does say that it works but nothing is selected&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 16:59:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60143#M4784</guid>
      <dc:creator>philbennison</dc:creator>
      <dc:date>2016-05-24T16:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60144#M4785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Phil...was typing from memory which can be stuck in older programs.&amp;nbsp; The Geoprocessing toolbox is where you will find the Python window option....but what I REALLY wanted to point you to is the RESULTs window under Geoprocessing.&amp;nbsp;&amp;nbsp; The "save as" is if you ran it in the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you run a script, and it is successful, you can right click on the name of the tool in the Results window and "Copy as python snippet".&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201928_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;This may look intimidating sometimes...but see the snippet, and what you really need (minimum) to get it to run...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#&amp;nbsp; from the copy from snippet...
arcpy.FeatureClassToFeatureClass_conversion(in_features="D:/___111136Cbu/WorkSpace/2004-05Hunts.mdb/bison_region_hunts", out_path="C:/__temp/test.gdb", out_name="test", where_clause="", field_mapping="""HUNTNO "HUNTNO" true true false 5 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,HUNTNO,-1,-1;RELATED "RELATED" true true false 50 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,RELATED,-1,-1;HUNTLABEL1 "LABEL1" true true false 25 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,HUNTLABEL1,-1,-1;HUNTLABEL2 "LABEL2" true true false 25 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,HUNTLABEL2,-1,-1;UNIT "UNIT" true true false 2 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,UNIT,-1,-1;SUBUNIT "SUBUNIT" true true false 1 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,SUBUNIT,-1,-1;REGION "REGION" true true false 2 Short 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,REGION,-1,-1;HUNTTYPE "HUNTTYPE" true true false 1 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,HUNTTYPE,-1,-1;DESC_ "DESCRIPTION" true true false 50 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,DESC_,-1,-1;COMMENTS "COMMENTS" true true false 40 Text 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,COMMENTS,-1,-1;SHAPE_Length "SHAPE_Length" false true true 8 Double 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,SHAPE_Length,-1,-1;SHAPE_Area "SHAPE_Area" false true true 8 Double 0 0 ,First,#,D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts,SHAPE_Area,-1,-1""", config_keyword="")

# what you really need from this is only required items...unless you are changing some mapping
arcpy.FeatureClassToFeatureClass_conversion(r'D:\___111136Cbu\WorkSpace\2004-05Hunts.mdb\bison_region_hunts', r'C:\__temp\test.gdb', "testout2")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SaveAs is from the python window, if you are running from that, and will have a cleaner look, similar to the last line in the above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, my apologies for confusing you...hope this makes more sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60144#M4785</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-10T22:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60145#M4786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This particular error is due to the file naming. In my code examples I used two forms of the paths to featureclass.&lt;/P&gt;&lt;P&gt;One is using the paths with single slashes like:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="_jivemacro_uid_14641140936123995 jive_macro_code jive_text_macro" data-renderedposition="60_8_1332_16" jivemacro_uid="_14641140936123995"&gt;&lt;P&gt; r'D:\Temp\test.shp'&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note the "r" in front of the path. This is to create a raw notation. Python will interpret a string and convert a "\t" into a &amp;lt;TAB&amp;gt;. Hence the error message you received:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;"Cannot create output C:\Users\Phiben\Documents\ArcGIS&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;&amp;lt;TAB&amp;gt;&lt;/EM&gt;&lt;/SPAN&gt;esti.shp Failed to execute..."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;...when you probably specified "&lt;EM&gt;C:\Users\Phiben\Documents\ArcGIS&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;\t&lt;/STRONG&gt;&lt;/SPAN&gt;esti.shp&lt;/EM&gt;" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other I used is the double slashes like&amp;nbsp; "D:\\Temp\\Test.gdb\\test"&lt;/P&gt;&lt;P&gt;You may be interested in reading this blog: &lt;A href="https://community.esri.com/migration-blogpost/55463"&gt;Filenames and file paths in Python&lt;/A&gt;&amp;nbsp; by &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The code I wrote in my Python windows, inside a session of ArcMap 10.4.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 18:27:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60145#M4786</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-05-24T18:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60146#M4787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes...paths can be bad... how many people use r"c:\temp\" or r"c:\temp" as paths&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; print("c:\temp")
c: emp
&amp;gt;&amp;gt;&amp;gt; print(r"c:\temp\")
Traceback (&amp;nbsp; File "&amp;lt;interactive input&amp;gt;", line 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; print(r"c:\temp\")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^
SyntaxError: EOL while scanning string literal
&amp;gt;&amp;gt;&amp;gt; print(r"c:\temp")
c:\temp
&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;P&gt;more surprises lurk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60146#M4787</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-10T22:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60147#M4788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gee Rebecca,&lt;/P&gt;&lt;P&gt;I would be intimidated by that as well&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 19:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60147#M4788</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-05-24T19:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60148#M4789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lol.&amp;nbsp; Ya Neil....drives me nuts that it has to list all of the field mappings and other arguments, even if the don't change or are default.&amp;nbsp; First thing I do is strip down to the minimum....or if I DO need things like the field mapping, pushing it off to a variable that I can use.....the full snippet is almost unreadable and probably does scare many off.&amp;nbsp; Too bad too....it's a great tool. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2016 19:43:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/60148#M4789</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-05-24T19:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using Python to replicate the Export Data command</title>
      <link>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/1005438#M59163</link>
      <description>&lt;P&gt;A general solution to this problem can be found here:&amp;nbsp;&lt;A href="https://desktop.arcgis.com/en/arcmap/10.7/tools/environments/qualified-field-names.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/10.7/tools/environments/qualified-field-names.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;simply add:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;env&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;qualifiedFieldNames&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="bp"&gt;False &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="bp"&gt;at the beginning of your script and the joined field names will not be renamed when exporting the data using e.g.&amp;nbsp;arcpy.CopyFeatures_management.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 07:44:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-python-to-replicate-the-export-data-command/m-p/1005438#M59163</guid>
      <dc:creator>ChristianPfeifer</dc:creator>
      <dc:date>2020-11-30T07:44:24Z</dc:date>
    </item>
  </channel>
</rss>

