Hello everyone, welcome to another ArcGIS Pro tutorial. In this article, we will learn a simple but useful trick to convert a string (text) to float (number) using Calculate field. In my case, I have a point layer with an elevation field/column in the attribute table. But unfortunately, the elevation values are not stored in number format. This will create an issue because I want to use the elevation values to produce Digital Elevation Model from the survey data points. Calculate Field is a powerful tool in ArcGIS Pro to manipulate the data attribute.
As you can see above, we will convert the field “hyoukouchi” from text to number. We will create a new field “elevation” to store the new values.
Open the Attribute Table and then click Calculate Field. The Calculate Field window will open up and we need to specify some variables here.
- Input table: Select the table you want to modify
- Field name: Elevation
- Expression Type: Python3
Elevation = float(!hyoukouchi!)
Don’t forget the “!” symbols
Click Apply or OK to start the process.
So now, we have a new Elevation field that contains the same data as the hyoukouchi field but this time the data is stored as number/float.