Is there a way I can change the data type of a field (possibly using the python window). I have about 25 shapefiles which are all named differently, but the name of the fields I want to change from text to double are the same.
-
You can do it (manually) in ArcCatalog, I believe -- ref. Modifying field properties– EricaCommented Sep 29, 2014 at 14:59
-
I thought so too! i.imgur.com/14nKO9v.png– Alan CarrCommented Sep 29, 2014 at 15:03
-
"If the field contains data, you cannot change data types that would lead to loss of data. For example, you cannot change a long integer or float to a short integer, or change a blob to a text."– ianbroadCommented Sep 30, 2014 at 1:24
1 Answer
No. There is no way to change a field type. Single biggest complaint of all time on the ideas site, ignored by Esri for over a decade. If they ever did it they would only support it in a geodatabase, never a shapefile (a dead end format). Access could do it if this was a Personal geodatabase and probably SDE databases could do it directly.
You have to create a new double field and calculate the string values into it in each table. Python could do that process in a loop if the files are in the same directory.
-
I've just re-exported my raw data, changed field types in MapInfo then translated it back into a shapefile Commented Sep 30, 2014 at 8:35