Hello all,
I am fairly new to python and am having issues renaming file paths within a table. I need to replace all of my \ for / within a field. \ is an escape so it is not working. Here is a brief snippet of my code:
arcpy.CalculateField_management(in_table="Assess", field="IMAGELINK", expression="""!IMAGELINK!.replace(r"\","/")""", expression_type="PYTHON_9.3", code_block="")
I know there are easy ways to do this with VB and with field calculator but I am trying to automatic a much bigger table update.
edit: I've tried using \ \ instead and still had no luck.
edit 2: This is ultimately what worked for me, thank you Joshua
expression<SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.498039); border: 0px; font-weight: inherit;">=</SPAN>r<SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;">"""!IMAGELINK!.replace("\\","/")"""</SPAN>
Any advice is much appreciated! Thanks