I'm a new user of ArcMap. And I'm not good at programming language.
There are the following shapefiles in workspace.
L01-1983_01.shp L01-1983_02.shp ... L01-1983_46.shp L01-1983_47.shp L01-1984_01.shp L01-1984_02.shp ... L01-1984_46.shp L01-1984_47.shp ... L01-2012_01.shp L01-2012_02.shp ... L01-2012_46.shp L01-2012_47.shp L01-2013_01.shp L01-2013_02.shp ... L01-2013_46.shp L01-2013_47.shp
File name has the following rule.
I want to merge all shapefiles for each year, for example,
L01-1983_01.shp L01-1983_02.shp ... L01-1983_46.shp L01-1983_47.shp -----merge---- L01_1983.shp ... L01-2013_01.shp L01-2013_02.shp ... L01-2013_46.shp L01-2013_47.shp -----merge---- L01_2013.shp
Below is my script.
list_year=["list_%d" % x for x in range(1983,2014)] year=1983 for i in list_year: i=ListFeatureClasses("*year*") year=year+1 years=range(1983,2014) for i in years: Merge_management(list_i,"L01_i.shp")
But I can't get merged files.
How can I write python script to merge shapefiles using a loop?