Created
June 19, 2015 16:31
-
-
Save tjmichael81/e90ed4bbdf6103d10eb6 to your computer and use it in GitHub Desktop.
Add number of fields to feature class with arcpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
fc = r'C:\folder\database.gdb\featureClass' | |
# fMax = number of fields that you need to create | |
# fNum = starting points | |
fMax = 300 | |
fNum = 1 | |
while fNum <= fMax: | |
# Add a new field to the feature class until fMax is reached | |
arcpy.AddField_management(fc, 'field_' + str(fNum), 'TEXT', None, None, 10) | |
print fNum | |
fNum = fNum + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment