Community and Regional
Planning Program
The University of Texas at Austin School
of Architecture
Changing an attribute field from string to number and vice versa
ArcView Tips Home Page
If you have an attribute field that is string type and it needs to be numeric
(e.g., parcel land values are numbers but in string format, and you want
them to be true numbers) you can do the following:
-
Open the attribute table and start editing - choose Table-Start Editing
-
Create a new attribute field (Edit - Add Field) that is numeric
in type. Make sure that it is wide enough to include your largest value,
and that it has decimal points if needed. Click OK.
-
The new field name should be highlighted in the table (if not make sure to
highlight it). Choose Field-Calculate or press the calculator icon
(
)
-
For the expression, double-click on the original field you want to change
so that it shows up in the expression (e.g., [land_value]), then type
the following:
.AsNumber
-
Your entire expression should look like
this:
[land_value].AsNumber
-
Assuming this works and your new field is filled, stop editing and save your
edits.
To go from a numeric value to a string value, you would follow the same procedure
but use the expression .AsString
Note: The X-Tools extension has a function under the Table X-Tools
menu called Table Structure - this will show you the structure of all the
attribute fields in a table, including what type they are.
14 November 2001
The School of Architecture at
UT Austin
Comments to: Barbara Parmenter