<?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 How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1166565#M54288</link>
    <description>&lt;P&gt;How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format in Model builder or script tool.&lt;/P&gt;&lt;P&gt;In CSV format GDB can differentiate with sheets and every sheet have count of respective feature classes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 11:23:57 GMT</pubDate>
    <dc:creator>Rakesh_Kumar_GIS</dc:creator>
    <dc:date>2022-04-21T11:23:57Z</dc:date>
    <item>
      <title>How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1166565#M54288</link>
      <description>&lt;P&gt;How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format in Model builder or script tool.&lt;/P&gt;&lt;P&gt;In CSV format GDB can differentiate with sheets and every sheet have count of respective feature classes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 11:23:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1166565#M54288</guid>
      <dc:creator>Rakesh_Kumar_GIS</dc:creator>
      <dc:date>2022-04-21T11:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1167411#M54391</link>
      <description>&lt;P&gt;Basic structure:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def get_gdb_feature_count(gdb_path):
    # set workspace to gdb
    prev_ws = arcpy.env.workspace
    arcpy.env.workspace = gdb_path
    # list all feature classes and tables in workspace
    fcs_and_tbls = arcpy.ListFeatureClasses() + arcpy.ListTables()
    # GetCount() on all of these
    counts = [int(arcpy.management.GetCount(ft)[0]) for ft in fcs_and_tbls]
    # revert workspace
    arcpy.env.workspace = prev_ws
    # return [ ["TableName", count] ]
    return zip(fcs_and_tbls, counts)


csv_path = "path:/to/your/csv_file.csv"
result = get_gdb_feature_count("path:/to/your/gdb")
with open(csv_path, "w") as f:
    f.write("Name,Count\n")
    for r in result:
        f.write(f"{r[0]},{r[1]}\n")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Apr 2022 09:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1167411#M54391</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-04-25T09:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1167816#M54426</link>
      <description>&lt;P&gt;Hi Johannes ,&lt;/P&gt;&lt;P&gt;Thanks your effort.&lt;/P&gt;&lt;P&gt;Please give me this script as a model builder.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Rakesh_Kumar_GIS_0-1650955485753.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/39834iED6619AA72BD2866/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Rakesh_Kumar_GIS_0-1650955485753.png" alt="Rakesh_Kumar_GIS_0-1650955485753.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for advance,&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 06:46:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1167816#M54426</guid>
      <dc:creator>Rakesh_Kumar_GIS</dc:creator>
      <dc:date>2022-04-26T06:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1168216#M54458</link>
      <description>&lt;P&gt;Sorry, I don't know how to do this in ModelBuilder.&lt;/P&gt;&lt;P&gt;Try running the script in the Python Window first, that makes it easier to troubleshoot.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 07:15:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1168216#M54458</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-04-27T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1168756#M54520</link>
      <description>&lt;P&gt;This can't be done in ModelBuilder tools, but you can use the Calculate Value tool like this in ModelBuilder.&lt;/P&gt;&lt;P&gt;Expression:&lt;STRONG&gt;&amp;nbsp;proc(r"C:\users\me\my.gdb", r"C:\users\me\my.csv")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Code Block:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def get_gdb_feature_count(gdb_path):
    # set workspace to gdb
    prev_ws = arcpy.env.workspace
    arcpy.env.workspace = gdb_path
    # list all feature classes and tables in workspace
    fcs_and_tbls = arcpy.ListFeatureClasses() + arcpy.ListTables()
    # GetCount() on all of these
    counts = [int(arcpy.management.GetCount(ft)[0]) for ft in fcs_and_tbls]
    # revert workspace
    arcpy.env.workspace = prev_ws
    # return [ ["TableName", count] ]
    return zip(fcs_and_tbls, counts)

def proc(gdb, csv_path):
    result = get_gdb_feature_count(gdb)
    with open(csv_path, "w") as f:
        f.write("Name,Count\n")
        for r in result:
            f.write(f"{r[0]},{r[1]}\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:45:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1168756#M54520</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2022-04-28T13:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169140#M54579</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325" target="_self"&gt;&lt;SPAN class=""&gt;curtvprice ,&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;can be set gdb path and csv&amp;nbsp; path as a parameter. if possible then please let me know.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;thanks,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Rakesh&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 04:23:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169140#M54579</guid>
      <dc:creator>Rakesh_Kumar_GIS</dc:creator>
      <dc:date>2022-04-29T04:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169141#M54580</link>
      <description>Use ModelBuilder variables for example r"%gdb% and r"%csv%" - the path is substituted in at runtime.&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Apr 2022 04:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169141#M54580</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2022-04-29T04:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169143#M54581</link>
      <description>&lt;P&gt;&lt;EM&gt;Thank you so much !!!!!!!&amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/1325" target="_self"&gt;&lt;SPAN class=""&gt;curtvprice&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;But I observe its working on both are same folder path.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;But any how... Its really usefull for me&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;thanks for your time in future I will defiantly reach you&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 04:49:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169143#M54581</guid>
      <dc:creator>Rakesh_Kumar_GIS</dc:creator>
      <dc:date>2022-04-29T04:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How we get Feature count of 2 GDB(Include dataset and feature class) in CSV format.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169144#M54582</link>
      <description>&lt;P&gt;And I think its not write dataset name and inside the dataset feature class.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 04:54:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-we-get-feature-count-of-2-gdb-include-dataset/m-p/1169144#M54582</guid>
      <dc:creator>Rakesh_Kumar_GIS</dc:creator>
      <dc:date>2022-04-29T04:54:07Z</dc:date>
    </item>
  </channel>
</rss>

