How to salvage a corrupt shapefile
The instructions below describe several options to help in salvaging a corrupt shapefile. Common causes of corruptions are a computer crash while saving edits; adding illegal geometry, for example, bow ties; or modifying the attribute table with other software, for example, Microsoft Excel. If the steps listed here do not salvage the shapefile, you will have to revert to the backup.
Options used to salvage a shapefile
Verify a backup of the data was made before attempting any of these options:
- Use the Check Geometry tool. Problems with the data are reported while the tool is executing or in the output table. View the output table after execution. An empty table indicates that the tool found no bad geometry. If bad geometry is reported, use the Repair Geometry tool.
- Try using the Repair Geometry tool.
- Attempt to copy the data to a geodatabase. Afterward, also try copying it back to a new shapefile.
- Try selecting all or a subset of the features and export the selected features to a new shapefile or feature class.
- If the data is on a network drive, copy it to a local drive. If the data is on a local drive, try copying it to the root of the primary drive, for example, C:\.
- Check for illegal field names in the attribute table. Field names can only have 10 characters. Field names must start with a letter. Field names must not contain any spaces or special characters, except for the underscore character.
- File names must not contain any special characters, except for the underscore character. Generally speaking, spaces in shapefile names work in ArcGIS for Desktop; however, for testing purposes, rename the shapefile so it has no spaces.
- Remove all index (spatial, attribute, and geocoding) and metadata files in Windows Explorer. That is, remove all files except .shp, .dbf, and .shx. Verify that a copy of each of these files has been made before removing them.
- Try opening the shapefile on another computer.
- Try opening the shapefile in another software application—preferably ArcView GIS 3.x.
- Try bringing the data into another feature class either by using the simple data loader or by copying and pasting in an edit session.
- If the data is still not repaired, and the first two suggestions above reported the feature IDs of the bad records, try manually removing them in an editing session.
- Try bringing the .dbf part of the shapefile into Microsoft Excel and resaving it as a dBASE 4 file. Do not make any other changes to the file.
- Try making a field calculation in ArcGIS for Desktop or ArcView GIS 3.x using the field calculator. The field calculator may stop on the corrupt record.