Delete Field (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Deletes one or more fields from a table of a feature class, feature layer, and/or raster catalog.
Usage tips
Delete Field can be used with any table, ArcSDE, file or personal geodatabase feature class, coverage, raster catalog, or shapefile.
You cannot delete fields from non-native data formats in ArcGIS, such as VPF and CAD datasets because they are read-only files.
The Drop Field parameter Add Field button is used only in ModelBuilder. In ModelBuilder, where the preceding tool has not been run, or its derived data does not exist, the Drop Field parameter may not be populated with field names. The Add Field button allows you to add expected fields so you can complete the Delete Field dialog and continue to build your model.
The following environment affects this tool: workspace.
Command line syntax
An overview of the Command Line window
DeleteField_management <in_table> <drop_field; drop_field...>
Parameter | Explanation | Data Type |
<in_table> |
The table containing the field that is to be deleted. The existing Input Table will be modified. |
Table View | Raster Layer |
<drop_field; drop_field...> |
The field, or fields, to be dropped from the Input Table. Only non-required fields may be deleted. The Add Field button, which is used only in ModelBuilder, allows you to add expected field(s) so you can complete the dialog and continue to build your model. |
Field |
deletefield "c:\test_data\soils.shp" "slope;loam"
Scripting syntax
About getting started with writing geoprocessing scripts
DeleteField_management (in_table, drop_field)
Parameter | Explanation | Data Type |
in_table (Required) |
The table containing the field that is to be deleted. The existing Input Table will be modified. |
Table View | Raster Layer |
drop_field (Required) |
The field, or fields, to be dropped from the Input Table. Only non-required fields may be deleted. The Add Field button, which is used only in ModelBuilder, allows you to add expected field(s) so you can complete the dialog and continue to build your model. |
Field |
import arcgisscripting gp = arcgisscripting.create() # Set a default workspace gp.workspace = "c:\\test_data" # Set a default workspace gp.toolbox = "management" try: # Delete fields from this shapefile. gp.deletefield ("soils.shp", "slope; loam") except: # If an error occurs when running Deletefield, print out the error message. print gp.GetMessages(2)