<?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: Create Feature Class using Field name and Alias from File in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522415#M87050</link>
    <description>&lt;P&gt;Here's a simple implementation that spits out a point feature class in Web Mercator and nullable long integer fields, should be easy to alter this to suit your needs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from os import path
def workbook_to_fc(file_path: str, fc_path: str):
    excel = arcpy.conversion.ExcelToTable(file_path, "memory\\fields")[0]
    arcpy.management.CreateFeatureclass(*path.split(fc_path), "POINT", spatial_reference=arcpy.SpatialReference(3857))
    fields = [[name, "LONG", alias, None, None, None] for _, name, alias in arcpy.da.SearchCursor(excel, "*")]
    arcpy.management.AddFields(fc_path, fields)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2024 17:59:11 GMT</pubDate>
    <dc:creator>DavidSolari</dc:creator>
    <dc:date>2024-08-15T17:59:11Z</dc:date>
    <item>
      <title>Create Feature Class using Field name and Alias from File</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522387#M87047</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a feature class from a file.&lt;/P&gt;&lt;P&gt;I want to be able to specify the field name and associated Alias based on the contents of the attached file.&lt;/P&gt;&lt;P&gt;Each new field is an Integer Type, with the field name to come from the cdLpaCode column and the associated alias from the indAlias column.&lt;/P&gt;&lt;P&gt;Is there a way of doing this in Python or Model Builder? I need to repeat the process for around a hundred files.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 17:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522387#M87047</guid>
      <dc:creator>Paul_Duffy_Waters_of_LIFE</dc:creator>
      <dc:date>2024-08-15T17:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create Feature Class using Field name and Alias from File</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522415#M87050</link>
      <description>&lt;P&gt;Here's a simple implementation that spits out a point feature class in Web Mercator and nullable long integer fields, should be easy to alter this to suit your needs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from os import path
def workbook_to_fc(file_path: str, fc_path: str):
    excel = arcpy.conversion.ExcelToTable(file_path, "memory\\fields")[0]
    arcpy.management.CreateFeatureclass(*path.split(fc_path), "POINT", spatial_reference=arcpy.SpatialReference(3857))
    fields = [[name, "LONG", alias, None, None, None] for _, name, alias in arcpy.da.SearchCursor(excel, "*")]
    arcpy.management.AddFields(fc_path, fields)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 17:59:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522415#M87050</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2024-08-15T17:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create Feature Class using Field name and Alias from File</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522769#M87075</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;Thanks for that. Unfortuntately I haven't a great deal of experience with Python yet!&lt;/P&gt;&lt;P&gt;If you have the time could you please indicate which elements I would need to modify?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 08:59:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/create-feature-class-using-field-name-and-alias/m-p/1522769#M87075</guid>
      <dc:creator>Paul_Duffy_Waters_of_LIFE</dc:creator>
      <dc:date>2024-08-16T08:59:57Z</dc:date>
    </item>
  </channel>
</rss>

