Delete attribute table data permanently

3346
6
04-14-2017 12:01 PM
RussKinyon
New Contributor

I have a table that includes data from all the counties in New York State. I want to delete most of that data so I only have 7 counties in the attribute table. I can run a selection query and delete the rows I don't want. But, when I open that shapefile again in another map, the data from all the counties is still in the table. 

How do I permanently delete table data from a shapefile or efficiently export just the data I want to a new shapefile layer?

Thanks!

Russ

0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus

An easier way would be to query for the places you want to keep, then right-click on the layer and Data, export data to a new featureclass or shapefile.  You can then remove the original for safe-keeping

JoshuaBixby
MVP Esteemed Contributor

How are you deleting the selected rows?  Opening up the attribute table and pressing delete, running the Delete Rows geoprocessing tool, or something else?

RussKinyon
New Contributor

I'm opening the attribute table from the layer, selecting by attribute and then deleting. When I reopen the map after closing it, the data table doesn't save the changes and all the rows are back. I just experienced something similar when I added a field and data to that field. I saved the map, but hours of work disappeared when reopening the file as the attributes table no longer shows the data I entered. For some reason, it's not saving the changes to the data table.

0 Kudos
RussKinyon
New Contributor

I figured it out. You have to go to the Edit tab and click Save. However, this is not obvious and takes steps that I don't understand. If you save the file, it should automatically save the edits, shouldn't it?

0 Kudos
DanPatterson_Retired
MVP Emeritus

Saving edits is a separate operation from saving a project, partly because edits can be abandoned when you stop an edit session... you are then given a chance to save the edits and if you don't want to, you can cancel the edit session and the file remains intact.  Saving the project is a similar operation.  If you just close a project, you are given a chance to save changes to it.  It would save changes to the project, but not the edit session for a file.  You can also be editing many things (ie toolboxes, etc) and one big massive save all could be dangerous if you only want parts saved.  It is just safer to treat each 'closure' as a separate entity whereby you can save the edits or abandon them, working your way back out to the final choice of saving the project.

JoshuaBixby
MVP Esteemed Contributor

This is what I was suspecting.  Since the behavior is different than an ArcMap, I think it trips people up sometimes.  In ArcMap, you had to explicitly start an edit session while in Pro it is the default and is done automatically.  In ArcMap, a user could do operations on data and the application would warn you it is outside of an edit session, but the user could still proceed.

There are some limit options that can be configured with editing and saving data:  Customize how you save edits.  For example, there is an option to "Save edits when saving project" that is disabled by default but can be enabled.

Just a note, if you select records and use a geoprocessing tool, like Delete Rows, the rows are permanently deleted outside of an edit session.  The automatic edit session only appears to happen when manipulating data manually using the attribute table view.