I am using ArcGIS Desktop 10.3.
A third party convert complex autocad drawing (dwg) to shapefile for us. I got from them a zip folder with 1 to 16 Shapefile (depending of the original dwg data), all shapefile come with 4 file (.dbf, .prj, .shp and .shx) and I can visualize the data without problem, the attribute table seem fine when I open it.
The problem arise when I try to update a field using either the field calculator or manually. The below picture illustrate the problem, first is the original table, second is after using the field calculator and third the calculator.
(for test purpose the calculate was only writing "A" in the ALT column (column in text format, length 255))
As you can see not only spaces are inserted before the A (as if I have " A" as input) but the POINT_X field got truncated and the POINT_Y and POINT_Z column are filled with what seem to be random value. The same thing happen if a manually edit a value, as soon as I save edits all value are modified.
the insertion of space before text column follow a pattern : no space added on first column, one space added on second column, two space on third and so on...
This kind of behavior happens on all field (text field get added space and numeric field are modified) on all shape from this provider. The only workaround is to export the shapefile (exported shapefile come with .cpg, .dbf, .prj, .sbn, .sbx, .shp and .shx and behave as expected).
I will ,of course, ask the provider of the shapefile to look into the problem and try to fix it, but I'm curious what it could cause this behavior and how to fix it on my side.
adding a .cpg file from a working shapefile doesn't change anything but exporting either to .shp or to gdb fix the problem.
This problem seem to be a specific Arcgis problem as the problem didn't occur on QGIS (can edit without problem) and opening a messed-up shp in QGIS show the text column without the extra space before the text but the numeric column are still wrong. After editing and saving the edit in QGIS the shp appear fine in Arcgis and can now be normally edited.