<?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 convert FeatureClasses(shape) to SDE gdb after save to.lyr in the same folder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/convert-featureclasses-shape-to-sde-gdb-after-save/m-p/8662#M699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;List FeatureClasses(shape) then covert to SDE gdb after save to.lyr &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks jsKins, it's working this script now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; So another question, about lyr; so my question is : when i export the shapefiles of my folderX(with subfloders) to geodatabase SDE, i want to save a file .lyr in myfolderX (their sub folder source) with this code python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; def fcs_in_workspace(workspace):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.env.workspace = workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for fc in arcpy.ListFeatureClasses():&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; print os.path.join(workspace, fc)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.FeatureClassToGeodatabase_conversion(fc, r"C:\\\\Documents and Settings\\xx\\Application Data\\ESRI\\Desktop10.0\\ArcCatalog\\Connection to xx.sde")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for ws in arcpy.ListWorkspaces():&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fcs_in_workspace(os.path.join(workspace, ws))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; except Exception as e:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; print e.message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.AddError(e.message)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Bests Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Nov 2011 13:56:41 GMT</pubDate>
    <dc:creator>fredsinti</dc:creator>
    <dc:date>2011-11-24T13:56:41Z</dc:date>
    <item>
      <title>convert FeatureClasses(shape) to SDE gdb after save to.lyr in the same folder</title>
      <link>https://community.esri.com/t5/python-questions/convert-featureclasses-shape-to-sde-gdb-after-save/m-p/8662#M699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;List FeatureClasses(shape) then covert to SDE gdb after save to.lyr &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks jsKins, it's working this script now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; So another question, about lyr; so my question is : when i export the shapefiles of my folderX(with subfloders) to geodatabase SDE, i want to save a file .lyr in myfolderX (their sub folder source) with this code python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; def fcs_in_workspace(workspace):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.env.workspace = workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for fc in arcpy.ListFeatureClasses():&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; print os.path.join(workspace, fc)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.FeatureClassToGeodatabase_conversion(fc, r"C:\\\\Documents and Settings\\xx\\Application Data\\ESRI\\Desktop10.0\\ArcCatalog\\Connection to xx.sde")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; for ws in arcpy.ListWorkspaces():&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fcs_in_workspace(os.path.join(workspace, ws))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; except Exception as e:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; print e.message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.AddError(e.message)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Bests Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Nov 2011 13:56:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/convert-featureclasses-shape-to-sde-gdb-after-save/m-p/8662#M699</guid>
      <dc:creator>fredsinti</dc:creator>
      <dc:date>2011-11-24T13:56:41Z</dc:date>
    </item>
  </channel>
</rss>

