AnsweredAssumed Answered

automate creating field names using addfield

Question asked by helenak on Jul 9, 2012
Latest reply on Jul 12, 2012 by m.gasior
System: ArcGIS 9.3

I have ten shapefiles: A01-A10
All of them have a field starting with A, such as A01, A02, A03... A10.

Now I want to add a field to each of their attribute table based on the AXX code.
The field will be name as AXXS, such as A01S, A02S..., A10S.

Please kindly advise how to write the field name using the expression of addfield code.
Thank you.

import arcgisscripting gp = arcgisscripting.create()  # Set a default workspace gp.workspace = "c:\\test_data"  # Set a toolbox gp.toolbox = "management"  try:     # Add a field to this shapefile, of type LONG     gp.addfield ("A01.shp", "AXXS", "double", 10, 3)