Suliman1

add value to result of calculation of the filed

Discussion created by Suliman1 on Aug 26, 2013
Latest reply on Aug 28, 2013 by CCStormwater
I need to put in filed path + filed_value.
filed value I calculate with next script:

import arcpy
input_based_on_raster = "C:\\1\\2\\fr_kv1_05002_05000_01_3np2_08_t_pss1_034412_180613_raster_reclass.shp"
arcpy.CalculateField_management(input_based_on_raster, "preview", "!cDataFileN!.replace(\".img\",\"_preview.jpg\").replace(\"\\\"\", \"\")", "PYTHON_9.3", "")

this code is put to "preview" folder the needed file name. But I need to put not simply filename, but filename with path like:
"C:\\folder\\foo_preview.jpg"
the folder variable is specified above. But I can't understand how to concatenate it with my file name. I tried to:
root = "c:\\folder\\"
arcpy.CalculateField_management(input_based_on_raster, "preview", root + "!cDataFileN!.replace(\".img\",\"_preview.jpg\").replace(\"\\\"\", \"\")", "PYTHON_9.3", "")

But it's do not work.

Outcomes