Select to view content in your preferred language

I'm Trying to add a space between two concatenated field values

950
3
Jump to solution
05-06-2014 12:01 AM
OLANIYANOLAKUNLE
Frequent Contributor
I want to add a space between two concatenated field values that would appear like this "Kunle Street", I've tried the code below but its not giving me the expected result any suggestions? Thank you



arcpy.CalculateField_management("Street", "STREET_NAME", "!NAME!" + " " + "!NAME_EXTEN!", "PYTHON_9.3", "")
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
markdenil
Frequent Contributor
instead of
"!NAME!" + " " + "!NAME_EXTEN!",

try
"%s %s" % (!NAME!, !NAME_EXTEN!)

or
"!NAME! + ' ' + !NAME_EXTEN!"

View solution in original post

0 Kudos
3 Replies
T__WayneWhitley
Honored Contributor
"'{} {}'.format(!NAME!, !NAME_EXTEN!)"
0 Kudos
markdenil
Frequent Contributor
instead of
"!NAME!" + " " + "!NAME_EXTEN!",

try
"%s %s" % (!NAME!, !NAME_EXTEN!)

or
"!NAME! + ' ' + !NAME_EXTEN!"
0 Kudos
OLANIYANOLAKUNLE
Frequent Contributor
instead of
"!NAME!" + " " + "!NAME_EXTEN!",

try
"%s %s" % (!NAME!, !NAME_EXTEN!)

or
"!NAME! + ' ' + !NAME_EXTEN!"


Thanks worked like magic.....
0 Kudos