<?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 Merge Fcs of Same name from multiple GDBs into new/Seprate GDB? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708553#M54926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Merging all feature classes with the same name nested in multiple geodatabases using ArcPy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/450529_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone kindly, assist me in resolving/modifying this code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the result (merge feature) but only one feature class (probably last FC of the iteration), how can I make it work for all the iterating FCs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't hesitate to ask for more clarity.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2019 11:00:02 GMT</pubDate>
    <dc:creator>VaibhavSingh_ESRI_GIS</dc:creator>
    <dc:date>2019-06-17T11:00:02Z</dc:date>
    <item>
      <title>Merge Fcs of Same name from multiple GDBs into new/Seprate GDB?</title>
      <link>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708553#M54926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Merging all feature classes with the same name nested in multiple geodatabases using ArcPy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/450529_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone kindly, assist me in resolving/modifying this code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting the result (merge feature) but only one feature class (probably last FC of the iteration), how can I make it work for all the iterating FCs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't hesitate to ask for more clarity.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2019 11:00:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708553#M54926</guid>
      <dc:creator>VaibhavSingh_ESRI_GIS</dc:creator>
      <dc:date>2019-06-17T11:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Fcs of Same name from multiple GDBs into new/Seprate GDB?</title>
      <link>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708554#M54927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this work for you:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy
import os

input_ws = # path to workspace to search for feature classes
output_ws = # path to workspace for merged feature classes

walk = arcpy.da.Walk(input_ws, datatype="FeatureClass")
di = {}

for root, dirs, files in walk:
    for name in files:
        di.setdefault(os.path.splitext(name)[0], []).append(os.path.join(root, name))
        
for name in di:
    arcpy.Merge_management(di[name], os.path.join(output_ws, name)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708554#M54927</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T05:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Fcs of Same name from multiple GDBs into new/Seprate GDB?</title>
      <link>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708555#M54928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, it worked!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So nice of you, now i am wondering how i can make the destination structure is same as Source, please refer following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/450562_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to your code, it worked and gives me merge feature in the destination gdb but merge fcs&amp;nbsp;inside GDB not like in source GDB structure ie Six FCS in feature dataset and one in GDB (outside dataset).Can you help me in doing that also,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2019 04:04:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708555#M54928</guid>
      <dc:creator>VaibhavSingh_ESRI_GIS</dc:creator>
      <dc:date>2019-06-18T04:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Fcs of Same name from multiple GDBs into new/Seprate GDB?</title>
      <link>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708556#M54929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This new requirement will involve changing part of the code.&amp;nbsp; I don't have time right now to look into it, but I may revisit it sometime this week.&amp;nbsp; In the meantime, moving 6 feature classes into a feature dataset in the final GDB isn't time consuming by hand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2019 17:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/708556#M54929</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-06-18T17:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Fcs of Same name from multiple GDBs into new/Seprate GDB?</title>
      <link>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/1085160#M61927</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I know it has been while since this was posted, but I am trying to do a similar thing for work. All of the features get put into their own feature classes, which is great, but a lot of the attribute data gets lost in this process. Should I be using a different method to combine data if I am worried about maintaining attribute integrity as well as spatial integrity? I am still learning python/arcpy and everything, so any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2021 03:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/merge-fcs-of-same-name-from-multiple-gdbs-into-new/m-p/1085160#M61927</guid>
      <dc:creator>DanielK2</dc:creator>
      <dc:date>2021-08-03T03:59:18Z</dc:date>
    </item>
  </channel>
</rss>

