I am using ArcGIS Desktop 10.1 SP1.

I have a feature (polygon) with nearly 60 fields in it. Now I want to delete all fields except 20(or a list of) and they are not one after one, no they are somewhere in the droplist. But to select for a tons around 40 feature shape files would be a huge searching and clicking time...because the update for every new loaded feature his droplist and i can start searching again and again.

Normally it must be go the opposite way...or?

I am looking for a tool or script by "inverse droping". From the web I did not get a useful solution.

  • So you have a feature class with multiple features (your polygons). This feature class has multiple fields (attributes) defined, around 60 ones. Your goal is to be able to delete all fields except those you want to define and you don't want to select 40 fields in the list of fields in the Delete Fielf GP tool. Correct? Jun 12, 2014 at 18:51
  • Yes, this i called invert delete :-)
    – user32330
    Jun 12, 2014 at 19:16
  • There was a command in ArcInfo Workstation called PULLITEMS that worked the way you describe. Its bonus behaviour was that it could re-order items/fields at the same time. I think you will find an existing ArcGIS Idea to have a Pull Fields tool implemented in ArcGIS for Desktop.
    – PolyGeo
    Jun 12, 2014 at 19:46

2 Answers 2


If you stay with the tools, you can first select all the fields then unselect the ones that you want to keep.

You could also create a Python script to do this, but if you don't have a fixed rule and you need to enter the field names manually, this will not help.

import arcpy   

# if you can use a key to identify the fields to remove, then it's solved
fields = arcpy.ListFields(fc) 

# manually enter field names to keep here
# include mandatory fields name such as OBJECTID (or FID), and Shape in keepfields
keepFields = ["OBJECTID", "Shape","fld1","fld3","fld20"]

dropFields = [x.name for x in fields if x.name not in keepFields]
# delete fields
arcpy.DeleteField_management(fc, dropFields)     
  • My list of fields which i need are in each feature class same. So this list of the 20 are fixed. But if i call everytime the tool, he reads the fieldlist again an i can start search in the list which ones i want. With python script i am not too much expired. In the arc tool help for deletefield is a stand-alone script example, but i didn't get it to run as script. this is new to me. I can post this script and maybe we could develop some code in it...
    – user32330
    Jun 12, 2014 at 19:20
  • you can use the above script directly in the command prompt in ArcMap. you just need to change "fc" by the name of your feature class.
    – radouxju
    Jun 12, 2014 at 19:30
  • Thanks. I will try it. This is what I looked for with the "if ... not in" :-)
    – user32330
    Jun 12, 2014 at 19:44
  • +1 Not only is this script very functional, it also shows how Python can be used to create very clean workflows by the list comprehension.
    – Aaron
    Jun 12, 2014 at 20:03
  • Yes I find this command: listfields() by searching the web but didnt know how to use it with python and arcgis...i am a little newbie by using python to make some automated workflows...
    – user32330
    Jun 12, 2014 at 20:38

Deleting the fields directly is an excellent and simple approach. However, you may want to be more conservative and create a copy of the original feature classes with only the fields you need. One approach is to create a model in ModelBuilder to do this for you. In the attached model, you can see an iterator is used to loop through all of the feature classes in a workspace. Feature Class To Feature Class (Conversion) is used to copy the features and delete the unnecessary fields. You can call the name variable for the output by using %name%. In this case, I attached _copy to the output name by using %name%_copy in the output parameter.

enter image description here

enter image description here

  • Have you tried using a model with an iterator?
    – Aaron
    Jun 12, 2014 at 20:31
  • I tried this, but in the result feature class where less attributes as in the original one...and i didnt find out why it was like that. And one problem is that this tool shows the arrow up and arrow down to sort the fields but this is not working...nothing happens.
    – user32330
    Jun 12, 2014 at 20:40
  • Could I use the Expression(optional) with some SQL-Code to select the fields i want? How it could look like?
    – user32330
    Jun 18, 2014 at 11:42
  • I write in it SELECT a, b FROM feature class, but the verify-button gaves me an error, and wrote that already a SELECT * FROM feature class WHERE SELECT a, b FROM feature class is invalid. So I understand that this Expression makes already a selection on all fields. Can I modify that after the WHERE he choose the fields I want or is that not possible?
    – user32330
    Jun 18, 2014 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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