<?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: Uploading multiple CSV files from folder using code in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155623#M53042</link>
    <description>&lt;P&gt;There is sample code in the help, but it is for loading 1 file&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/xy-table-to-point.htm" target="_blank"&gt;XY Table To Point (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can right-click on the tool in ArcToolbox and try it in batch mode&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xytabletopoint.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36816iFC78D6CB5FF4D1D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xytabletopoint.png" alt="xytabletopoint.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then if you want a script, you can export to a script and modify it to suit your needs&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 09:41:49 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-03-21T09:41:49Z</dc:date>
    <item>
      <title>Uploading multiple CSV files from folder using code</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155615#M53041</link>
      <description>&lt;P&gt;I'm trying to read multiple CSV files to my arcGIS pro project.&lt;/P&gt;&lt;P&gt;The csv files consist x,y coordinated so I would like to upload them to the project and show them on the map, as happends when I upload the CSV file through the 'MAP'--&amp;gt;'Add Data'--&amp;gt;'X,Y Point Data'.&lt;/P&gt;&lt;P&gt;I do this action very often so I would like to automate it.&lt;/P&gt;&lt;P&gt;I'll be happy to get some guidance or a script to do so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tnx a lot&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 09:22:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155615#M53041</guid>
      <dc:creator>OriHarash</dc:creator>
      <dc:date>2022-03-21T09:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading multiple CSV files from folder using code</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155623#M53042</link>
      <description>&lt;P&gt;There is sample code in the help, but it is for loading 1 file&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/xy-table-to-point.htm" target="_blank"&gt;XY Table To Point (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can right-click on the tool in ArcToolbox and try it in batch mode&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xytabletopoint.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36816iFC78D6CB5FF4D1D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xytabletopoint.png" alt="xytabletopoint.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then if you want a script, you can export to a script and modify it to suit your needs&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 09:41:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155623#M53042</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-03-21T09:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading multiple CSV files from folder using code</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155627#M53043</link>
      <description>&lt;P&gt;When you do it manually, you open the tool&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/xy-table-to-point.htm" target="_blank"&gt;XY Table To Point (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;To automate the process, you could use a script like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;csv_files = [
    "H:/test.csv",
    # etc.
    ]

import os
wkid = 25832 # the wkid of your coordinate system
x = "X"
y = "Y"
z = None
gdb = None  # path to the database where you want to save the feature class. None: default gdb of your project
for csv in csv_files:
    print(csv)
    name = os.path.basename(csv).split(".")[0]
    if gdb is not None:
        name = os.path.join(gdb, name)
    arcpy.management.XYTableToPoint(csv, name, x, y, z, wkid)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Mar 2022 09:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/uploading-multiple-csv-files-from-folder-using/m-p/1155627#M53043</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-03-21T09:57:08Z</dc:date>
    </item>
  </channel>
</rss>

