The use case is exporting a feature class via a Python script (arcgisscripting v9.3x. Only a few of the columns are needed in the result feature class.

I commonly use the fieldmappings/fieldmap objects to rename columns. The docs state that you can also use them to delete a field as the feature class is being exported. Can anyone provide an example of this?


The last sample in the Mapping input fields to output fields help topic has a python example of removing a field from a field map. Here's the relevant code:

fieldmappings = arcpy.FieldMappings()

That is for 10 but it looks like there were similar methods at 9.3: FieldMappings properties

  • I hadn't seen that method, but it is in the 9.3 object model. – DavidF Feb 17 '11 at 15:29

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.