number of shapes does not match the number of table records

5615
18
10-03-2014 02:02 PM
MikeHenson
Occasional Contributor

just made a quick map. I imported a shp file containing only 1 point marking the location of a sewer plant. I go to edit that shape file, but adding a text field with the name of the plant, so i can create an automatic label.  Looks great until I close arcmap, and then try to re-open that map. I get the above message. Any way to fix it, or more importantly, how do i keep it from happening? Any help will be greatly appreciated.

0 Kudos
18 Replies
MikeHenson
Occasional Contributor

File should be there now

0 Kudos
DanPatterson_Retired
MVP Emeritus

Okay Mike

0 Kudos
DanPatterson_Retired
MVP Emeritus

OK  ... Folks...Mike isn't nuts
I loaded Mike's shapefiles into a new project...one loaded...the other gave the error.
I proceeded to edit "Good File" and added a simple text field populated it, saved edits, and everything was going good.
I then...thinking cleverly...I exported the edited file to a new shapefile, saved the project, closed ArcMap, opened the project and now Mike's "GoodFile" is now Mike's "Bad File" and my file loaded no sweat.
I then...thinking less cleverly...opened a brand new blank project...my file opened no problem, but both of Mike's files are dead.  I am hesitant to repeat this scenario again for fear perpetuating the Einstein's mis-attributed definition of insanity.

Mike...I will look further at this...someone else have a go please

0 Kudos
MikeHenson
Occasional Contributor

So if I add a field, and then I export it to a new file it would work? Is that what I am reading? Anyway…I am glad someone else was able to recreate the error. Not fun!

0 Kudos
DanPatterson_Retired
MVP Emeritus

No No read carefully...exporting to the new file did not work ‌I am left with the file I exported, but your file...the one I edited...is now toast

0 Kudos
JorgeOrellana
Occasional Contributor II

If you open the DBF in excel of the file that works, you will notice that it is empty. If you open the attribute in arc it says that you you have the FID and Shape type. however this cannot not be right as Feature Classes must have at least one other field than Shape and FID. Something must have gone funky with the export from CAD.

It is still quite the mystery as to why Arc would let you open the shp file even though it violates the DBF rules.

DanPatterson_Retired
MVP Emeritus

Clever Watson!  Jorge is indeed right, there is no Id field, hence, exporting it makes it a useable file...but you just can't edit it!  So don't use CAD to create shapefiles, although I suspect this error would have been found long ago if this were the sole case.  Are there options when exporting in the other software?

0 Kudos
DanPatterson_Retired
MVP Emeritus

The plot thickens...I added an Id field (Long, precision 9) to the file that was missing it, exported to a new file, edited the previous file. saved the project, reloaded the project and the edited and exported files loaded file.  The only thing is that the Id field is out of order

0 Kudos
AlexRoss
New Contributor II

Sooooooo 6 years later, I think I found a solution, still working with it, let me know if anyone else has figured it out. 

I've been getting the same error when I export to shapefile from Autocad Civil3D 2018 to shapefile. Number of shapes in the table doesn't match... 

I use the MAPEXPORT command to do this. What I had not done in the past was to check any attributes under the Data tab. Did this for the first time and selected the below options, as they likely were some of the only unique values, b/c why the heck not have unique ones to backcheck if something happens.

this results in a non-empty .dbf file! I haven't messed around with the resultant shapefile to see if it holds up after editing, but I would imagine this solves the issue.

Also, sat in on an Esri/Autodesk seminar a couple weeks ago, Civil3D 2020 is going to completely change the interfacing between the two programs, can't wait to streamline some processes. 

0 Kudos