Select to view content in your preferred language

How to change field from string to double?

3302
2
08-03-2011 07:32 AM
MikeWissner
New Contributor II
I did a simple percentage calculation in an Excel sheet before adding the data to arc.  When I bring the table into arc the two fields with the percentages calculated are identified as string.  I need them as double so that I can display symbology through their quantities.  I tried to go back into excel and change the format of the columns and this did not work.  Please help!
Tags (2)
0 Kudos
2 Replies
DanEvans
Occasional Contributor II
Well you can't change an already existing field's type but you can specify what data type you want each field to be when you import the Excel sheet into your geodatabase (or .dbf file). Right-click on the field in the field map and go to properties and you can choose the type. ArcGIS will try to convert the values for you if it can but I think maybe in your case you have percentage symbols (%) in there too, which is why it brought them in as strings at first. I think if that's the case and you try to convert to integer or double you'll just get zeros or <null>.

Probably the best thing to do now you've already got the table in ArcGIS is to add a new double field and use the field calculator to strip any non-numerical characters before copying them into the new field.

Hope that helps
Dan
0 Kudos
MikeWissner
New Contributor II
Thanks Dan.

Yes, the problem was the presence of non-numerical characters.  Once removed, the field type remained double once brought in from excel.  Success!
0 Kudos