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. 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 are a lot of field names to enter). Can I just have GIS to generate fields that are based on the existing fields without me listing them?
Image of table is attached.
Best Answer
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:
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: