0

When I go to merge some polygons, it automatically adds an FID for each polygon as a column. It takes forever to go through and delete each FID for the output. Two questions: Is there a way to prevent Arc from adding each FID column to the output during the merge step? If not, is there a quick way to delete all of them?

This might be an easy fix, but I've been working on it longer than I would like...

Attribute Table Output

Merge Inputs

  • If you have a defined output schema, you might be able to use Append instead of Merge, just create a blank featureclass with your desired fields, as your target featureclass. – klewis Jun 12 at 16:17
2

You can use Field Mapping (bottom part of your "Merge Inputs" screenshot) to merge all FIDs into the same column. But if you dont need the FID values it is easier to delete the columns after merge.

A quick way of deleting them is to use arcpy. List all fields with name starting with 'FID' then pass the list to Delete Field. Execute in python window of ArcMap:

import arcpy

fc = r'C:\somefolder\mergeoutput.shp' #Change to match your data

fields_to_delete = [f.name for f in arcpy.ListFields(fc) if f.name.upper().startswith('FID') and f.required==False]
arcpy.DeleteField_management(in_table=fc, drop_field=fields_to_delete)

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.