<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Replace Stand Alone Script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514599#M40391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That script does nothing since the field is never acquired.&amp;nbsp; It would probably just be faster to use the field calculator to accomplish what you need, however, if you need to do this within a script, then you have to implement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field.htm"&gt;Calculate Field—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unless you want to get involved with update cursors&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jul 2019 17:18:13 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2019-07-05T17:18:13Z</dc:date>
    <item>
      <title>Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514598#M40390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to remove prefixes from a field, eg. SV192W001 to 192W001.&amp;nbsp; I run the following code and it runs without any errors but when I look at the field none of the prefixes are removed/replaced.&amp;nbsp; Any help appreciated.&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env

&lt;SPAN class="comment token"&gt;# Set workspace&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"B:/Projects/Duplicate Assets/Duplicate.gdb/dwSystemValve"&lt;/SPAN&gt;

fieldName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ValveID"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Remove prefixes from ValveID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Removing prefixes"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldName&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SV"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldName&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"HV"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldName&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SR"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Done"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:29:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514598#M40390</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2021-12-11T22:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514599#M40391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That script does nothing since the field is never acquired.&amp;nbsp; It would probably just be faster to use the field calculator to accomplish what you need, however, if you need to do this within a script, then you have to implement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field.htm"&gt;Calculate Field—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unless you want to get involved with update cursors&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 17:18:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514599#M40391</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-07-05T17:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514600#M40392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Normally field names cannot be changed but there is a geoprocessing tool for that: &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/alter-field-properties.htm"&gt;Alter Field&lt;/A&gt; (only supported in ArcGIS Pro). In ArcMap you need to create a new field, copy the data over using Calculate Field (as Dan suggests) and delete the old field once you have verified the data&amp;nbsp;have been successfully copied.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should warn you that field names starting with a number can cause you major problems down the road&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/curtvprice/blog/2016/05/07/how-to-name-things-in-arcgis?sr=search&amp;amp;searchId=2e41b637-a244-44e9-84ad-8888868bbd37&amp;amp;searchIndex=0"&gt;https://community.esri.com/people/curtvprice/blog/2016/05/07/how-to-name-things-in-arcgis?sr=search&amp;amp;searchId=2e41b637-a244-44e9-84ad-8888868bbd37&amp;amp;searchIndex=0&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 20:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514600#M40392</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2019-07-05T20:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514601#M40393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did think using field calculator, but I have more to this script and additional feature classes.&amp;nbsp; I did implement Calculate Field and it sort of worked.&amp;nbsp; At the end of the process I looked at my data and only the "ZB" was removed from all values containing it in the ValveID field.&amp;nbsp; Does the CalculateField_management tool only accept one statement in the expression or does it have the ability to accept multiple statements?&amp;nbsp; I tried using '&amp;amp;' and ',' instead of 'and' and both returned errors.&amp;nbsp; Here is my updated code.&amp;nbsp; Still a newbie to python and trying to get a hang of it.&amp;nbsp; Thanks for your help.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env

&lt;SPAN class="comment token"&gt;# Set workspace&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"B:/Projects/Duplicate Assets/Duplicate.gdb"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Set variables&lt;/SPAN&gt;
inTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"dwValves_copy"&lt;/SPAN&gt;
fieldName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ValveID"&lt;/SPAN&gt;
expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!ValveID!.replace("SV","")'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!ValveID!.replace("HV","")'&lt;/SPAN&gt; 
&lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!ValveID!.replace("SR","")'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!ValveID!.replace("ZB","")'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Remove prefixes from ValveID&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Removing prefixes"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inTable&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PYTHON3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Done"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:29:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514601#M40393</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2021-12-11T22:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514602#M40394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector, you would need a code block, in calculate field&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;r&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="string token"&gt;"""replace the values in the field"""&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; a &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SV"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"HV"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SR"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ZB"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; a&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;your condition wasn't an 'and' but an 'or' since the row value can only be 1 thing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression section&lt;/P&gt;&lt;P&gt;r(!YourField!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:29:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514602#M40394</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T22:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514603#M40395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh,&amp;nbsp;your new code makes it more clear to me what you are trying to do. Here are some expressions that should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!ValveID!.replace("SV","").replace("HV","").replace("SR","").replace("ZB","")'&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# or simply remove the first two characters:&lt;/SPAN&gt;
expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'!ValveID![2:]‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514603#M40395</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T22:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514604#M40396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2019 22:00:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514604#M40396</guid>
      <dc:creator>GIS_geek</dc:creator>
      <dc:date>2019-07-05T22:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Replace Stand Alone Script</title>
      <link>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514605#M40397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;inTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"dwValves_copy"&lt;/SPAN&gt;
fieldName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ValveID"&lt;/SPAN&gt;

code_block &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'''
def r(a):
    """replace the values in the field"""
    if a in ("SV", "HV", "SR", "ZB"):
        return a.replace(a, "")
    return a
'''&lt;/SPAN&gt;

expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"r(!ValveID!)"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CalculateField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;inTable&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fieldName &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PYTHON3"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;should you need to add more values to your list of things to replace, just add them to line 7&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/replace-stand-alone-script/m-p/514605#M40397</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T22:29:42Z</dc:date>
    </item>
  </channel>
</rss>

