1

I have a table with two fields. One field (type short) is empty. One field (type string) is full of digits. There are no random characters in that field, just digits. I want to convert the string digits into integers and put them in the empty field.

How do I do this in the field calculator?


Figured it out. The strings of digits were 8 digits long. That would make an integer too large for a type short. I made a new field of type long and field calculator converted it easily.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jun 13, 2018 at 16:53
1
  • You can just calc them equal to each other. The values should be cast automatically. Commented Jun 13, 2018 at 16:57

2 Answers 2

1

Open field calculator on the blank column and set the parser to python

Find the existing (string) column header on the left panel and double click it to bring the field name into the code block. Then click ok, this will copy all values from the string column into the short type column.

answered Jun 13, 2018 at 17:00
2
  • Doesn't work. when I try that I get an error. The Results console says "The value type is incompatialbe with the field type" Commented Jun 13, 2018 at 17:23
  • you said you had spaces in the original field? you can confirm all values are in fact integers with no string characters Commented Jun 13, 2018 at 18:17
1

String to Integer using Field calculator (VB Scribt)

As mentioned in ArcGIS Technical Support

You can convert the string field to integer by doing the following:

Right-click on your integer field>> Field calculator>> (VB Scribt) then just choose your string field from the fields box

 =[FieldName]
answered Jun 13, 2018 at 17:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.