Skip to content

Instantly share code, notes, and snippets.

@HerbFargus
Last active March 8, 2017 22:09
Show Gist options
  • Save HerbFargus/cf9d6e09f5d25d2a703f0cc871ad1f4b to your computer and use it in GitHub Desktop.
Save HerbFargus/cf9d6e09f5d25d2a703f0cc871ad1f4b to your computer and use it in GitHub Desktop.
Arcmap Field Calculator (Python): Concatenate values from fields that are not NULL
#Pre-Logic Script Code:
def concat_fields(field1, field2, field3, field4):
if field1.strip() == "" or field2.strip() == "" or field3.strip() == "" or field4.strip() == "":
return ""
else:
return field1 + "/" + field2 + "/" + field3 + " " + field4
#FIELD=
concat_fields( !Field1!, !Field2!, !Field3!, !Field4!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment