I have researched How to add attribute field to existing Shapefile via Python without ArcGIS? but could not implement it.

Can give me examples of how to add field name in attribute table?

I have to show a hyperlink in the attribute table , using an online query.


All of the geoprocessing tools can be setup in ModelBuilder within ArcGIS. Once in ModelBuilder you can export the code out as python. To run the code you can either right click it in Windows Explorer and run it with python.exe or copy the code line for line into IDLE (Python GUI), which is installed with ArcGIS.

# Import arcpy module
import arcpy

# Local variables:
point_shp = "C:\\temp\\point.shp"

# Process: Add Field
arcpy.AddField_management(point_shp, "NEWFIELD", "TEXT", "", "", "25", "", "NON_NULLABLE", "NON_REQUIRED", "")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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