<?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: Accessing shapefiles/dbfs within a geodatabase with python in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660858#M37484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A href="https://community.esri.com/migrated-users/51169"&gt;Thomas Caruso &lt;/A&gt;‌, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although &lt;A href="https://community.esri.com/migrated-users/3343"&gt;Joe Flannery&lt;/A&gt;‌ may have answered your question and you are able to access your shapefile stored in the .gdb folder. this is not (and I repeat) *NOT* they way to solve your problem. As &lt;A href="https://community.esri.com/migrated-users/3051"&gt;Vince Angelo&lt;/A&gt;‌ indicates, you should NOT store shapefiles in the .gdb folder. It may corrupt the other data in the file geodatabase, Please, please, *PLEASE*, remove the files from the .gdb folder and store them elsewhere. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a list of file extensions you will want to move to another folder, see: &lt;A href="http://en.wikipedia.org/wiki/Shapefile" title="http://en.wikipedia.org/wiki/Shapefile"&gt;Shapefile - Wikipedia, the free encyclopedia&lt;/A&gt;&amp;nbsp; or this old documentation: &lt;A href="http://webhelp.esri.com/ARCGISDESKTOP/9.2/index.cfm?TopicName=Shapefile_file_extensions" title="http://webhelp.esri.com/ARCGISDESKTOP/9.2/index.cfm?TopicName=Shapefile_file_extensions"&gt;ArcGIS Desktop Help 9.2 - Shapefile file extensions&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Dec 2014 01:59:16 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2014-12-31T01:59:16Z</dc:date>
    <item>
      <title>Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660853#M37479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel like there's a very simple answer to this because no matter how much I searched I couldn't find one, however I'm pretty much brand new to gdb's, have mostly just used shapefiles up until now and I'm having trouble getting python to access the table of/a shapefile within a geodatabase. Here is the script I'm writing currently, can someone give me some direction here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
# Set workspace
arcpy.env.workspace = "C:\Users\tmc18\Desktop\comp_orps\NYS_Wells.gdb"

# Define input feature layer &amp;amp; wells
orps09 = "C:\Users\tmc18\Desktop\comp_orps\centroids\madirps_point_Layer.lyr"
wells = "C:\Users\tmc18\Desktop\comp_orps\NYS_Wells.gdb\Madison_DEC_Well_Logs_3_14_14_MASTER_COPY.dbf"
wellshp = "C:\Users\tmc18\Desktop\comp_orps\NYS_Wells.gdb\Madison_DEC_Well_Logs_3_14_14_MASTER_COPY.shp"

# Define fields cursors will require
county = "County"

# Create search cursor
with arcpy.da.SearchCursor(wells, [county]) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&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; if county == "MADISON":
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByLocation_management(orps09, [within_a_distance, "1 km", add_to_selection])
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.next(row)
&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; else:
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting errors because within the gdb, the dbf and shapefiles don't exist. Since I see them there in ArcCatalog I thought it might work anyways, but obviously that is not the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:58:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660853#M37479</guid>
      <dc:creator>ThomasCaruso</dc:creator>
      <dc:date>2021-12-12T03:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660854#M37480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need an r in front of your file paths? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this:&lt;/P&gt;&lt;P&gt;wells = r"C:\Users\tmc18\Desktop\comp_orps\NYS_Wells.gdb\Madison_DEC_Well.dbf"&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 16:42:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660854#M37480</guid>
      <dc:creator>JoeFlannery</dc:creator>
      <dc:date>2014-12-30T16:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660855#M37481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shapefiles are &lt;STRONG&gt;NOT&lt;/STRONG&gt; stored within file geodatabases.&amp;nbsp; Each is a different format.&amp;nbsp; Data &lt;EM&gt;copied&lt;/EM&gt; from a shapefile is manifested as a &lt;STRONG&gt;&lt;EM&gt;table&lt;/EM&gt;&lt;/STRONG&gt; in an FGDB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should not use a filesystem utility to place a shapefile in the ".gdb" directory of a file geodatabase. To copy the data into the FGDB, use ArcGIS or an application with the FGDB API access library enabled to create a new feature class table in the FGDB workspace. If you want to retain shapefile format, create a directory parallel to the .gdb (e.g., "NYS_Wells-shp"), and place the shapefiles there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 16:46:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660855#M37481</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2014-12-30T16:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660856#M37482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This did it. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 16:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660856#M37482</guid>
      <dc:creator>ThomasCaruso</dc:creator>
      <dc:date>2014-12-30T16:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660857#M37483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Thomas:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;For future readers of your posted question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;From the &lt;SPAN style="text-decoration: underline;"&gt;great&lt;/SPAN&gt; book &lt;EM&gt;Python Scripting for ArcGIS&lt;/EM&gt;, by Paul Zandbergen, Chapter 4.14 - Working with Paths:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;There are three correct ways to specify a path in Python:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;Use a forward slash&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;&amp;nbsp; “C:/EsriPress/Python/Data”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;Use two backslashes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;&amp;nbsp; “C:\\EsriPress\\Python\\Data”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;Use a string literal by placing the letter &lt;EM&gt;r&lt;/EM&gt; before the string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-size: 12pt;"&gt;&amp;nbsp; r“C:\EsriPress\Python\Data”&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 17:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660857#M37483</guid>
      <dc:creator>JoeFlannery</dc:creator>
      <dc:date>2014-12-30T17:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660858#M37484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A href="https://community.esri.com/migrated-users/51169"&gt;Thomas Caruso &lt;/A&gt;‌, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although &lt;A href="https://community.esri.com/migrated-users/3343"&gt;Joe Flannery&lt;/A&gt;‌ may have answered your question and you are able to access your shapefile stored in the .gdb folder. this is not (and I repeat) *NOT* they way to solve your problem. As &lt;A href="https://community.esri.com/migrated-users/3051"&gt;Vince Angelo&lt;/A&gt;‌ indicates, you should NOT store shapefiles in the .gdb folder. It may corrupt the other data in the file geodatabase, Please, please, *PLEASE*, remove the files from the .gdb folder and store them elsewhere. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a list of file extensions you will want to move to another folder, see: &lt;A href="http://en.wikipedia.org/wiki/Shapefile" title="http://en.wikipedia.org/wiki/Shapefile"&gt;Shapefile - Wikipedia, the free encyclopedia&lt;/A&gt;&amp;nbsp; or this old documentation: &lt;A href="http://webhelp.esri.com/ARCGISDESKTOP/9.2/index.cfm?TopicName=Shapefile_file_extensions" title="http://webhelp.esri.com/ARCGISDESKTOP/9.2/index.cfm?TopicName=Shapefile_file_extensions"&gt;ArcGIS Desktop Help 9.2 - Shapefile file extensions&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 01:59:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660858#M37484</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-31T01:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing shapefiles/dbfs within a geodatabase with python</title>
      <link>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660859#M37485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's also a nice article in the ArcGIS Desktop help.&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//01m10000000s000000" style="line-height: 1.5;" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//01m10000000s000000"&gt;Paths explained: Absolute, relative, UNC, and URL &lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 06:48:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/accessing-shapefiles-dbfs-within-a-geodatabase/m-p/660859#M37485</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-12-31T06:48:18Z</dc:date>
    </item>
  </channel>
</rss>

