Skip to main content
added 46 characters in body
Source Link
radouxju
  • 50.2k
  • 2
  • 72
  • 144

My guess when I see this error message is that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy, glob arcpy.env.workspace = "your_workspace" fcs#fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes fcs = glob.glob("c:\\*\\*.shp") #EDIT tobemerged = [] for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50150) #length of 50 is usually enough arcpy.CalculateField_management(fc, "name", fc[:-4]fc, "PYTHON") #[:-4] because I assume that you have a shapefile and remove the extension tobemerged.append(fc) arcpy.Merge_management(tobemerged, "output_feature_class_name") 

My guess when I see this error message is that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy arcpy.env.workspace = "your_workspace" fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes tobemerged = [] for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50) #length of 50 is usually enough arcpy.CalculateField_management(fc, "name", fc[:-4], "PYTHON") #[:-4] because I assume that you have a shapefile and remove the extension tobemerged.append(fc) arcpy.Merge_management(tobemerged, "output_feature_class_name") 

My guess when I see this error message is that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy, glob arcpy.env.workspace = "your_workspace" #fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes fcs = glob.glob("c:\\*\\*.shp") #EDIT tobemerged = [] for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 150) #length of 50 is usually enough arcpy.CalculateField_management(fc, "name", fc, "PYTHON") #[:-4] because I assume that you have a shapefile and remove the extension tobemerged.append(fc) arcpy.Merge_management(tobemerged, "output_feature_class_name") 
added 279 characters in body
Source Link
radouxju
  • 50.2k
  • 2
  • 72
  • 144

My guess when I see this error message idis that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy arcpy.env.workspace = "your_workspace" fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes

for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50) #length of 50 is usually enough arcpy

import arcpy arcpy.env.workspace = "your_workspace" fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes tobemerged = [] for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50) #length of 50 is usually enough arcpy.CalculateField_management(fc, "name", fc[:-4], "PYTHON") #[:-4] because I assume that you have a shapefile and remove the extension tobemerged.append(fc) arcpy.Merge_management(tobemerged, "output_feature_class_name") 

My guess when I see this error message id that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy arcpy.env.workspace = "your_workspace" fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes

for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50) #length of 50 is usually enough arcpy

My guess when I see this error message is that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy arcpy.env.workspace = "your_workspace" fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes tobemerged = [] for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50) #length of 50 is usually enough arcpy.CalculateField_management(fc, "name", fc[:-4], "PYTHON") #[:-4] because I assume that you have a shapefile and remove the extension tobemerged.append(fc) arcpy.Merge_management(tobemerged, "output_feature_class_name") 
Source Link
radouxju
  • 50.2k
  • 2
  • 72
  • 144

My guess when I see this error message id that the length of your string is not large enough to store the value of "name". Check in your "Add field" step to make this.

By the way, string manipulation is better done with Python:

import arcpy arcpy.env.workspace = "your_workspace" fcs = arcpy.ListFeatureClasses("*") #get the list of feature classes

for fc in fcs: print len(fc) #check for the length of your name arcpy.AddField_management(fc, "name", "TEXT", 50) #length of 50 is usually enough arcpy