Select to view content in your preferred language

How can I delete millions of attribute in ArcMap 10.5

564
2
07-19-2023 09:15 PM
Labels (3)
SikderSaeeduzzaman
New Contributor

 

I have a shapfile which contains 8316420 attributes. I need to delete around 600000 attributes. I am using select by attributes option. But, when I am trying this option it's not working.

Is there any easy way to delete millions of attributes?

 

Tags (1)
0 Kudos
2 Replies
JohannesLindner
MVP Frequent Contributor

Select Layer By Attribute will be very slow for that many features.

 

You could use your query to make a new layer with Make Feature Layer. This layer will contain only features that you want to delete, so just select them all and delete.

 

Or you could d o it with a little Python script:

layer = "LayerName"
query = "SomeField = 'DELETE ME'"

with arcpy.da.UpdateCursor(layer, ["OID@"], query) as cursor:
    for row in cursor:
        cursor.deleteRow()

 

These will edit your shapefile, so make a backup!


Have a great day!
Johannes
0 Kudos
Faiez
by
Occasional Contributor II

1. Open your attributes table in ArcMap

2. Open search option, write delete field ...

3. Select Data Management Tool

4.Select Field, here you can find many options to select one field or multiple fields and proceed further for deleting attributes field.

5. If you want to delete records, just create one new field and fill it with two options 0 and 1. Write 1 for those records you want to keep and 0 for those records you do not need.

I hope it will works for you

Good luck