<?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: Copying file names in folder directory to FGDB Table in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086786#M25744</link>
    <description>&lt;P&gt;Thanks David.&amp;nbsp; This works great.&amp;nbsp; The only change that I made to your code was to add brackets around 'f' so it read: cursor.insertrow([f])&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 21:17:46 GMT</pubDate>
    <dc:creator>CraigPrisland2</dc:creator>
    <dc:date>2021-08-06T21:17:46Z</dc:date>
    <item>
      <title>Copying file names in folder directory to FGDB Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086340#M25740</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm looking to build a Python script that will take the file names of PDFs in a certain folder directory and copy them to a new FGDB table.&amp;nbsp; I am able to print these file names using the following simple script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os, arcpy

arcpy.env.workspace = r'\\ch_gis\gis\......'
files = arcpy.ListFiles()
for f in files:
   print f&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and get the expected outcome:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CraigPrisland2_0-1628195081366.png" style="width: 116px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20302iF771862BA1C74779/image-dimensions/116x66?v=v2" width="116" height="66" role="button" title="CraigPrisland2_0-1628195081366.png" alt="CraigPrisland2_0-1628195081366.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;However, I am having troubles trying to copy these file names to an empty FGDB table.&amp;nbsp; Any assistance would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Craig&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 20:25:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086340#M25740</guid>
      <dc:creator>CraigPrisland2</dc:creator>
      <dc:date>2021-08-05T20:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Copying file names in folder directory to FGDB Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086365#M25741</link>
      <description>&lt;P&gt;What do you mean by copy them exactly? as in just add the filepath strings to a column in the table? Does the table and column already exist? I'd say just an insert cursor.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 21:05:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086365#M25741</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-08-05T21:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Copying file names in folder directory to FGDB Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086386#M25742</link>
      <description>&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;To clarify, I do have a table and field already created.&amp;nbsp; I'm looking to just copy the file names (i.e. WP20150014.pdf) to the table.&amp;nbsp; Thanks for the suggestion of the insert cursor.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 21:34:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086386#M25742</guid>
      <dc:creator>CraigPrisland2</dc:creator>
      <dc:date>2021-08-05T21:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Copying file names in folder directory to FGDB Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086390#M25743</link>
      <description>&lt;P&gt;untested&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os

arcpy.env.workspace = r'\\ch_gis\gis\......'
files = arcpy.ListFiles()
for f in files:
   print(f)

fields = ['your field']
cursor = arcpy.da.InsertCursor(r'path to your table', fields)

for f in files:
    cursor.insertRow((f))

del cursor&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Aug 2021 22:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086390#M25743</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-08-05T22:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Copying file names in folder directory to FGDB Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086786#M25744</link>
      <description>&lt;P&gt;Thanks David.&amp;nbsp; This works great.&amp;nbsp; The only change that I made to your code was to add brackets around 'f' so it read: cursor.insertrow([f])&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 21:17:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/copying-file-names-in-folder-directory-to-fgdb/m-p/1086786#M25744</guid>
      <dc:creator>CraigPrisland2</dc:creator>
      <dc:date>2021-08-06T21:17:46Z</dc:date>
    </item>
  </channel>
</rss>

