<?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: Simple Merge of Shapefiles in a single folder in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337131#M26449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Works!&lt;BR /&gt;Only thing is that it only renames the .shp files and none of the associated files (.dbf,.prj, ect.) so the merge gives an error saying it cannot be completed probably because it cannot see the associated filetypes. However, I assume that I can just rewrite this for each of the filetypes and once they are all renamed the merge should work as expected? Fingers crossed.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would just copy the shapefiles with a different name into another folder, much safer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
ws = "D:/eCognition Results/Landcover/Buildings"
arcpy.env.workspace = ws
out = "D:/eCognition Results/Landcover/Buildings/Outputs"
for file in arcpy.ListFeatureClasses():
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(file, os.path.join(out,file.replace('.','_')[:-4] + '.shp'))
arcpy.env.workspace = out&amp;nbsp;&amp;nbsp; 
Listing = arcpy.ListFeatureClasses()
arcpy.Merge_management(Listing,"MergedFile.shp")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This *should work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:58:04 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-11T15:58:04Z</dc:date>
    <item>
      <title>Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337113#M26431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am very new to Python scripting and apparently not very good at it. I have a single folder with many shapefiles that I need to merge into a single shapefile. They are in the same projection and will not hit the 2gb limit so I assume this would be the easiest type of script to write. I have been trying to execute from PythonWin since that is the IDE the ESRI training uses but at this point I don't care where I execute it just that it works. I assume the workflow to be something like: import arcpy, set the environment to that particular folders location, apply overwrite to true, create a list of the shapefiles in the folder (i assume by telling it to look for all files with the ending ".shp"), the using the Merge_management to execute the merge. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; So with that said, could anyone offer some help. I have found a few other scripts online but they have some extra arguements for parsing and what not and I could not get them to work. All help appreciated&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 17:00:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337113#M26431</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2012-12-05T17:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337114#M26432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os

out = r'Output\folder\location' # change this
arcpy.env.workspace = r'Some\Path\Name'&amp;nbsp; #change this
shplist =&amp;nbsp; arcpy.ListFeatureClasses('*.shp')
arcpy.Merge_management(shplist, os.path.join(out, 'Merged_fc.shp'))
print 'done'

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337114#M26432</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337115#M26433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm getting an error for invalid input. This seems to be the same problem I have had with the other scripts. Can't find any extra info on the input parameters in the help section.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2012 21:09:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337115#M26433</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2012-12-05T21:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337116#M26434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Weird, this works for me.&amp;nbsp; The input parameters need to be supplied as a list (in square brackets []).&amp;nbsp; Can you add a print statement to show the list? Perhaps you can find the problem there.&amp;nbsp; Here is a script converting coverages to shapefiles and merging at the end.&amp;nbsp; I have a similar merge operation below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os, sys, traceback
arcpy.env.overwriteOutput = True

# Workspace for interchange files
ws = r'C:\IGIC\Beginner\Unit_1\DATA\EffigyMounds\InterchangeFiles'
arcpy.env.workspace = ws

# Local Variables
out = r'C:\IGIC\Beginner\Unit_1\DATA\EffigyMounds\Fire'

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Creates a folder if it doesn't already exist
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not os.path.exists(out):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.makedirs(out)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # List all ArcInfo Interchange files (.e00)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for cov in arcpy.ListFiles('*.e00'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportFromE00_conversion(cov, ws, cov.split('.')[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Converted %s' %cov

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Exclude Interchange files and info folder
&amp;nbsp;&amp;nbsp;&amp;nbsp; for cov in arcpy.ListFiles():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not '.e00' in cov and cov != 'info':
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = os.path.join(ws,cov)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in arcpy.ListFeatureClasses('*polygon'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion(fc, out, '%s.shp' %cov)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shp = os.path.join(out, '%s.shp' %cov)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Converted Coverage to %s' %shp

&amp;nbsp;&amp;nbsp;&amp;nbsp; # List shapefiles in folder to create input list for merge
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = out
&amp;nbsp;&amp;nbsp;&amp;nbsp; shplist =&amp;nbsp; arcpy.ListFeatureClasses()
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Merge_management(shplist, os.path.join(out, 'All_Fires.shp'))
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'done'
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Get the traceback object
&amp;nbsp;&amp;nbsp;&amp;nbsp; tb = sys.exc_info()[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp; tbinfo = traceback.format_tb(tb)[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\nError Info:\n" + str(sys.exc_info()[1])
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages(2) + "\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(pymsg)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddError(msgs)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Print Python error messages for use in Python / Python Window
&amp;nbsp;&amp;nbsp;&amp;nbsp; print pymsg + "\n"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print msgs

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337116#M26434</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337117#M26435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is the ultra simplified version.&amp;nbsp; Merge all fcs in the given directory into a shapefile called "Merged.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.env.workspace = "c:/junk/mergeMe"
fcs = arcpy.ListFeatureClasses()
arcpy.Merge_management(fcs, "Merged.shp")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337117#M26435</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2021-12-11T15:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337118#M26436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tyler:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What exactly is the error message that you are receiving?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, can you post the code that you are trying to run?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 12:23:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337118#M26436</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-12-06T12:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337119#M26437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So this is what my code looks like (copied from the python window). I am sure I have some simple error but it is hard to fix when your still at the starting gate. Is there some way that I can actually see what the Listing looks like? As in have it create a simple .txt or something similar so I can see if the ListFeatureClasses command is even finding what it is supposed to find? I tried to simply "print Listing" but all I get are "[]" as a result which makes me think it is not seeing the file in the first place for some reason. This file has about 15 shapefiles (and their associated files) generated by the eCognition image processing software and I am using it for testing because I have much bigger ones with thousands of very small shapefiles that I am really gonna need Python for. Anyway, my error message below is talking about input parameters. Really wish they offered a python course here at my university. Again I appreciate the help from you guys.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "D:eCognition Results/Landcover/Buildings"
&amp;gt;&amp;gt;&amp;gt; Listing = arcpy.ListFeatureClasses()
&amp;gt;&amp;gt;&amp;gt; arcpy.Merge_management(Listing,"MergedFile.shp")
Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: Failed to execute. Parameters are not valid. ERROR 000735: Input Datasets: Value is required Failed to execute (Merge). &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337119#M26437</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2021-12-12T16:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337120#M26438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It appears that you are getting an empty list.&amp;nbsp; I would double check your path to make sure it is correct.&amp;nbsp;&amp;nbsp; Also, not sure if this is the issue, but I would try putting an underscore between Cognition and Results (Cognition_Results) for that folder.&amp;nbsp; ArcGIS does not like spaces in paths.&amp;nbsp; I would do that then use your print statement (your print statement is correct).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 15:03:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337120#M26438</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-06T15:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337121#M26439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Tyler:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like this line might show the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "D:eCognition Results/Landcover/Buildings"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should it read something like this instead:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "D:/eCognition Results/Landcover/Buildings"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where you are currently missing a slash.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 15:20:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337121#M26439</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-12-06T15:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337122#M26440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are right. Im missing a forward slash after "D:". Now I just feel silly. So I was able to print the Listing file but now at the mergeManagment I get the same error but with the actual filenames I was looking for at least.&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Merge_management(Listing,"MergedFile.shp")
Runtime error &amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;: Failed to execute. Parameters are not valid. ERROR 000732: Input Datasets: Dataset campus_ortho.tiles.tile00.v5.shp;campus_ortho.tiles.tile01.v8.shp;campus_ortho.tiles.tile02.v5.shp;campus_ortho.tiles.tile03.v6.shp;campus_ortho.tiles.tile04.v5.shp;campus_ortho.tiles.tile05.v9.shp;campus_ortho.tiles.tile06.v9.shp;campus_ortho.tiles.tile07.v9.shp;campus_ortho.tiles.tile08.v10.shp;campus_ortho.tiles.tile09.v8.shp;campus_ortho.tiles.tile10.v8.shp;campus_ortho.tiles.tile11.v8.shp;campus_ortho.tiles.tile12.v8.shp;campus_ortho.tiles.tile13.v9.shp;campus_ortho.tiles.tile14.v9.shp;campus_ortho.tiles.tile15.v8.shp;campus_ortho.tiles.tile17.v8.shp;campus_ortho.tiles.tile18.v9.shp does not exist or is not supported Failed to execute (Merge). 
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;An example of the shapefile names would be "campus_ortho.tiles.tile00.v5.shp" whereas each tile from my project was assigned a unique name upon export. Does this name have anything to do with the error I am recieving? I am not sure what characters are reserved in filenames when it comes to this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:21:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337122#M26440</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2021-12-12T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337123#M26441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It may have something to do with the periods before the .shp extension on the shapefiles.&amp;nbsp; I would rename them by replacing the periods with underscores.&amp;nbsp; Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
arcpy.env.workspace = "D:/eCognition Results/Landcover/Buildings"
for file in arcpy.ListFiles('*.shp'):
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.rename(os.path.join(ws,file), os.path.join(ws,file.replace('.','_')[:-4] + '.shp'))
Listing = arcpy.ListFeatureClasses()
arcpy.Merge_management(Listing,"MergedFile.shp")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this doesn't work, I'm stumped.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337123#M26441</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337124#M26442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are these raster datasets?&amp;nbsp; The merge_management documentation says that this data type is not supported.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 15:50:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337124#M26442</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-12-06T15:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337125#M26443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Caleb,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I went and renamed the files by hand and it worked like a charm. Thanks for the help. Now I just have to get the rename code to work so I don't have to do them all by hand.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 16:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337125#M26443</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2012-12-06T16:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337126#M26444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Caleb,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; I went and renamed the files by hand and it worked like a charm. Thanks for the help. Now I just have to get the rename code to work so I don't have to do them all by hand.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess I should have mentioned that code was not thoroughly tested.&amp;nbsp; I copied several of the names of your shapefiles and renamed them as text files and ran this code.&amp;nbsp; It did successfully convert those txt files to shp, but I do not know how that would work with real shapefiles.&amp;nbsp; It may work with taking out the wild card that I had in the first time. I also changed it to ListFeatureClasses() which I do not know why I didn't do that the first time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
arcpy.env.workspace = "D:/eCognition Results/Landcover/Buildings"
for file in arcpy.ListFeatureClasses():
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.rename(os.path.join(ws,file), os.path.join(ws,file.replace('.','_')[:-4] + '.shp'))
Listing = arcpy.ListFeatureClasses()
arcpy.Merge_management(Listing,"MergedFile.shp")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337126#M26444</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337127#M26445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If THAT doesn't work (renaming shapefiles may not have been a good idea to begin with), here is my last idea:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
ws = "D:/eCognition Results/Landcover/Buildings"
arcpy.env.workspace = ws
out = "D:/eCognition Results/Landcover/Buildings/Outputs"
for file in arcpy.ListFeatureClasses():
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(file, os.path.join(out,file.replace('.','_')[:-4] + '.shp'))
arcpy.env.workspace = out&amp;nbsp;&amp;nbsp; 
Listing = arcpy.ListFeatureClasses()
arcpy.Merge_management(Listing,"MergedFile.shp")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this does not work, Python: 1,&amp;nbsp; Me: 0&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:57:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337127#M26445</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337128#M26446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried the first one and the logic seems to make sense to me but I get an 'exeptions.NameError'&amp;gt;: name 'ws' is not defined' So I am looking over the rename function to see what those parameters are all about. Can't be far from it now. Again man thanks for all the help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 17:49:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337128#M26446</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2012-12-06T17:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337129#M26447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I tried the first one and the logic seems to make sense to me but I get an&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;'exeptions.NameError'&amp;gt;: name 'ws' is not defined'&lt;/SPAN&gt; So I am looking over the rename function to see what those parameters are all about. Can't be far from it now. Again man thanks for all the help.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ah! That is my fault! I had a ws variable in my test script on my end. Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
ws = "D:/eCognition Results/Landcover/Buildings"
arcpy.env.workspace = ws
for file in arcpy.ListFeatureClasses():
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.rename(os.path.join(ws,file), os.path.join(ws,file.replace('.','_')[:-4] + '.shp'))
Listing = arcpy.ListFeatureClasses()
arcpy.Merge_management(Listing,"MergedFile.shp")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem was I had a variable set for the workspace and used that to append the paths and forgot to do that in yours. If you copied and pasted what I had, that was probably the problem the whole time! Sorry!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:58:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337129#M26447</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337130#M26448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Only thing is that it only renames the .shp files and none of the associated files (.dbf,.prj, ect.) so the merge gives an error saying it cannot be completed probably because it cannot see the associated filetypes. However, I assume that I can just rewrite this for each of the filetypes and once they are all renamed the merge should work as expected? Fingers crossed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 19:18:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337130#M26448</guid>
      <dc:creator>TylerJones2</dc:creator>
      <dc:date>2012-12-06T19:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337131#M26449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Works!&lt;BR /&gt;Only thing is that it only renames the .shp files and none of the associated files (.dbf,.prj, ect.) so the merge gives an error saying it cannot be completed probably because it cannot see the associated filetypes. However, I assume that I can just rewrite this for each of the filetypes and once they are all renamed the merge should work as expected? Fingers crossed.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I would just copy the shapefiles with a different name into another folder, much safer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy, os
ws = "D:/eCognition Results/Landcover/Buildings"
arcpy.env.workspace = ws
out = "D:/eCognition Results/Landcover/Buildings/Outputs"
for file in arcpy.ListFeatureClasses():
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(file, os.path.join(out,file.replace('.','_')[:-4] + '.shp'))
arcpy.env.workspace = out&amp;nbsp;&amp;nbsp; 
Listing = arcpy.ListFeatureClasses()
arcpy.Merge_management(Listing,"MergedFile.shp")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This *should work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337131#M26449</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T15:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Merge of Shapefiles in a single folder</title>
      <link>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337132#M26450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Old thread, but helped me in Arc 10.2 with very little tweaking. Thanks a million, Caleb Mackey.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 17:18:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-merge-of-shapefiles-in-a-single-folder/m-p/337132#M26450</guid>
      <dc:creator>DonnetteThayer</dc:creator>
      <dc:date>2015-11-13T17:18:06Z</dc:date>
    </item>
  </channel>
</rss>

