I iterate through a list of shapefiles and do some geoprocessing chains and field calculations for each of the input shapes (works fine).The result is a dbf for each of the input shapefiles. Now I'd like to write the name of the input shapes into a field in the output dbf and then merge the dbfs. Merging works also fine. The naming process worked fine using ArcGIS 10 or 10.1, but fails using ArcGIS 10.2 and Python 2.7.3.Some snippets:
#Blabla Environment + Import
(...)
#List FCs
name = []
x = 0
fcList = arcpy.ListFeatureClasses()
for fc in fcList:
print fc
name.insert(x, fc.split(".")[0])
x += 1
#Blabla Geoprocessing
(...)
#Write Name into output dbf and merge
x=0
for fc in fcList:
arcpy.AddField_management(input,"NAME", "TEXT")
arcpy.CalculateField_management(input,"NAME", "name", "PYTHON")
x += 1
out = outws + "Merge" + ".dbf"
result = arcpy.Merge_management (input, out)
Printing x, the input and name returns the right values for x and the file names (e.g. B, C, D, E, F). But only the first name is written into the table, e.g.:FID------BLA----NAME0 -------- . ------B1 -------- . ------B2 -------- . ------B3 -------- . ------B4 -------- . ------BAny idea? By the way, I get now error message, but the info "returned exit code 0".ThanksKathrin