I am trying to create a file path and add it to a field by concatenating the path with a file name that is held in a field in my data.My path is a constant \Links\Sheets\Project\ and my Drawing_Name field has values like Drawing01.pdf, Drawing02.pdf etc.
I keep getting the error:
The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. Failed to execute (CalculateField).
The function is written like this...
<SPAN class="comment token"># Process: Calculate Field</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CalculateField_management<SPAN class="punctuation token">(</SPAN>Centroids<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"URL"</SPAN><SPAN class="punctuation token">,</SPAN> expression<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"PYTHON_9.3"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
And for my expression I want something like one of these...
expression = "\"\\\\Links\\\\Sheets\\\\Project\\\\\"+ !Drawing_Name!"
expression = "\"\\Links\\Sheets\\Project\\{0}\".format( !Drawing_Name! )"<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I want to end up with \Links\Sheets\Project\Drawing01.pdf in the field.
The first expression used to work, but seems to throw the error above now - I believe it is my punctuation which is the problem - can anyone help?
Thanks
Rebecca