1

I am using ArcMap 10 from ArcGIS 10.2.1 package.

I got an attribute table, with few collumns. I need to replace some column "String_A" entries with newer "String_B" entries, in the same row. In both "String_A" and "String_B" columns are some values. Some entries in column "String_A" dont need to be changed, only those, where "String_B" entries not . Both columns are strings.

I am doing it by hand for now, but it would be nice to have a script in Python that can do it for me, because from time to time I need to update table with some new entries.

I am learning Python, but with my knowledge for today I can't do this task. So, I need some help with Field calculator and Python.

From "String_B" to "String_A" replace entries, example in the picture:

enter image description here

asked May 15, 2014 at 16:50
0

1 Answer 1

1

If I'm understanding, you want to replace values in field A with values from column B when the value in field A doesn't match the value in field B, is that correct? If so, you don't really need a python script. Simply select all values where field A <> field B (or alternately, select where field A = field B and then switch selection). Then run Field Calculator on Field A, setting it equal to field B. Field Calculator will only run on the records you selected.

I apologize if that's not what you meant. If you still want python code, post that and you shall have it.

answered May 15, 2014 at 19:48
1
  • Thanks for your answer! It helped! Exactly what I needed. Commented May 16, 2014 at 5:59

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.