Posts

Showing posts with the label FieldCalculator

Creating a new field with attributes incrementing by 1

Image
pre-logic script code: rec=0 def autoIncrement( ):  global rec  pStart = 1   pInterval = 1   if (rec == 0):    rec = pStart   else:    rec = rec + pInterval   return rec

Removing string character from Field for FIELD CALCULATOR in ArcGIS

Image
Documenting: I want to remove String character "m" from the ELEVATION contour shapefile and convert String field to numerical Int or Double to get value of contour for geoprocessing. In ArcGIS 10.1, > create a new field containing length of string  : "LEN"       > calculate using Feild Calculator String Function len( )          > len ( ELEVATION) > Double field ELEV can be calculated      > Left( [ELEVATION], [len]-1 )