Geospatial Modelling Environment

field.delete (Delete Fields)

Deletes one or more fields from a table


This tool deletes one or more fields from a table. If more than one field is specified, but one of the fields does not exist, the tool will continue to attempt to delete the other fields. An asterisk (*) can be used at the start and/or end of the field name as a wildcard, but it cannot be used in the middle of the field name. Also, the asterisk wildcard is only recognized when a single string is provided to the 'fld' parameter, but not in an array of string. For example, these are all valid uses of an asterisk: fld=AR*, or fld=*SIZE, or fld=*AA*. These are NOT valid uses of an asterisk: fld=A*BC, or fld=*A*B*, or fld=c(AREA, PERIM*).

Using wildcards to delete fields can be dangerous! Take great care in how the wildcard text is specified. There is no undo, so the delete is permanent. As a precaution this tool will never delete a geometry field or any of the special unique ID fields (thus the FID field is protected, but typically the ID field is not as it is commonly just an integer field).


field.delete(in, field);

inthe input feature data source
fieldthe names of the field(s) to delete (use the c() format to specify more than one field - see example below)


field.delete(in="C:\data\referencelayer.shp", field="MYFLD1");

field.delete(in="C:\data\roads.shp", field=c("NAME", "PROV", "SURFACE"));

field.delete(in="C:\data\roads.shp", field="LEN*");


Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently 


Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn