<?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: Shapefile to Geodatabase scripting? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/shapefile-to-geodatabase-scripting/m-p/124849#M9713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all&lt;BR /&gt;&lt;BR /&gt;I've built a model in model builder (9.2) and need to export the resulting output shape files into a Geodatabase within the same directory.&lt;BR /&gt;&lt;BR /&gt;Normally I would use the 'Feature class to Geodatabase' tool within model builder however there are different output shape files created each time I run the model therefore conventional tools are not apopropriate.&lt;BR /&gt;&lt;BR /&gt;I'm fairly new to Python and need the barebones of a script that will cut shapefiles from a directory into my Geodatabase.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tom&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Quickly put together, but it worked for me (ArcGIS 9.3.1).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcgisscripting gp = arcgisscripting.create()&amp;nbsp; inputLocation = "C:\shps"&amp;nbsp; gp.Workspace = inputLocation&amp;nbsp; fcs = gp.ListFeatureClasses()&amp;nbsp; fcs.reset() fc = fcs.next() while fc: &amp;nbsp; ### to work with a File GDB, then use the .gdb extension &amp;nbsp; gp.FeatureClasstoGeodatabase(fc, inputLocation + "\\testFGDB.gdb") &amp;nbsp; ### to work with a Personal GDB, then use the .mdb file extension instead &amp;nbsp; gp.FeatureClasstoGeodatabase(fc, inputLocation + "\\testPGDB.mdb")&amp;nbsp; &amp;nbsp; gp.AddMessage(str(fc) + " loaded into GDB") &amp;nbsp; fc = fcs.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2012 10:57:49 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2012-11-19T10:57:49Z</dc:date>
    <item>
      <title>Shapefile to Geodatabase scripting?</title>
      <link>https://community.esri.com/t5/python-questions/shapefile-to-geodatabase-scripting/m-p/124848#M9712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've built a model in model builder (9.2) and need to export the resulting output shape files into a Geodatabase within the same directory.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Normally I would use the 'Feature class to Geodatabase' tool within model builder however there are different output shape files created each time I run the model therefore conventional tools are not apopropriate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm fairly new to Python and need the barebones of a script that will cut shapefiles from a directory into my Geodatabase.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 07:56:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shapefile-to-geodatabase-scripting/m-p/124848#M9712</guid>
      <dc:creator>TomHutchinson</dc:creator>
      <dc:date>2012-11-19T07:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Shapefile to Geodatabase scripting?</title>
      <link>https://community.esri.com/t5/python-questions/shapefile-to-geodatabase-scripting/m-p/124849#M9713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all&lt;BR /&gt;&lt;BR /&gt;I've built a model in model builder (9.2) and need to export the resulting output shape files into a Geodatabase within the same directory.&lt;BR /&gt;&lt;BR /&gt;Normally I would use the 'Feature class to Geodatabase' tool within model builder however there are different output shape files created each time I run the model therefore conventional tools are not apopropriate.&lt;BR /&gt;&lt;BR /&gt;I'm fairly new to Python and need the barebones of a script that will cut shapefiles from a directory into my Geodatabase.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tom&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Quickly put together, but it worked for me (ArcGIS 9.3.1).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcgisscripting gp = arcgisscripting.create()&amp;nbsp; inputLocation = "C:\shps"&amp;nbsp; gp.Workspace = inputLocation&amp;nbsp; fcs = gp.ListFeatureClasses()&amp;nbsp; fcs.reset() fc = fcs.next() while fc: &amp;nbsp; ### to work with a File GDB, then use the .gdb extension &amp;nbsp; gp.FeatureClasstoGeodatabase(fc, inputLocation + "\\testFGDB.gdb") &amp;nbsp; ### to work with a Personal GDB, then use the .mdb file extension instead &amp;nbsp; gp.FeatureClasstoGeodatabase(fc, inputLocation + "\\testPGDB.mdb")&amp;nbsp; &amp;nbsp; gp.AddMessage(str(fc) + " loaded into GDB") &amp;nbsp; fc = fcs.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 10:57:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/shapefile-to-geodatabase-scripting/m-p/124849#M9713</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-11-19T10:57:49Z</dc:date>
    </item>
  </channel>
</rss>

