[GIS] How to merge many shape with the same name in different folders

arcgis-10.0mergeshapefileunion

I've many (hundreds) shape (3D points and 3D polygons) that have the same name, saved in different folders; and I've tried to merge them using batch with Merge tool in ArcGIS… but inexplicably ArcGis say that cannot process file with the same name! I'Now it's clear that I've too many files to rename them.

I've then used QGis and the process works, but lose the elevation information (Z) that I need.

I've seen other analogue questions but nothing directly usable. Some suggestions for a simply solution?

Best Answer

You can prefix all shapefiles with the folder that they are found within. A simple model as shown below can achieve this.

The model to change shapefile names

So your initial folder file structure may be this:

Sample tree strucure

After running this model all shapefile will be prefixed with the folder they they are found within (e.g. T2_myData.shp). Your data then has unique names so they will be valid input for your tool.

Related Question