Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I add in multiple fields in the attribute table? In the attribute table I have crop types such as corn, cotton, sorghum....etc (as shown image below), in square meters. and I want to generate new fields so I can calculate into acres. I am using python that would have add fields, but I would still have to provide field names, one by one (and there is a lot of field names to enter). Can I just have GIS to generate fields that are based on the existing fields without me list them?

Image of table is attached.

enter image description hereThanks!

share|improve this question

You'll have to loop through your current fields with ListFields. Then in your AddField_management() call just add '_acres' or something that identifies it as different from your current field name.

Something along these lines:

for field in arcpy.ListFields(featureClass):
    arcpy.AddField_management(featureClass, + '_acres', 'FLOAT')

If you don't want to add a new field for every field in your feature class, you'll have to add some simple conditional statements:

for field in arcpy.ListFields(featureClass):
    if == 'badField': # Name of field you don't want to add acreage for
        print "Not going to add this field"
        arcpy.AddField_management(featureClass, + '_acres', 'FLOAT')
share|improve this answer
Create a list of fields to be skipped skiplist=["skip1","skip2"] then use if field in skiplist: for the if statement – mhoran_psprep Jul 12 '12 at 17:20
field + '_acres' does not work.... is there other ways I can rename the existing field name? – asianpenguin Jul 12 '12 at 17:34
Sorry -- listing the fields only gives you the location in memory. If you print field in the loop you'll get something crazy. Try (I changed the code in my answer). – Roy Jul 12 '12 at 17:39
You might also consider adding multiple fields with one arcpy statement by unpacking tuples:… – Alex Tereshenkov Oct 30 '13 at 12:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.