<?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 Python - How to do a character replace when an ! is involved in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-how-to-do-a-character-replace-when-an-is/m-p/668673#M51887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having an issue replacing an ! as a character from my record.&amp;nbsp; I want to replace a ! as a [blank].&amp;nbsp; I tried using this statement, but it does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.CalculateField_management(CISAddressSDEFL, "NEIGHBOUR", "!NEIGHBOUR!.replace(\"!\", \"\")", "PYTHON", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other special characters work, but not the !.&amp;nbsp; Any ideas on how to perform a replace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Apr 2017 21:15:40 GMT</pubDate>
    <dc:creator>IanPeebles</dc:creator>
    <dc:date>2017-04-03T21:15:40Z</dc:date>
    <item>
      <title>Python - How to do a character replace when an ! is involved</title>
      <link>https://community.esri.com/t5/python-questions/python-how-to-do-a-character-replace-when-an-is/m-p/668673#M51887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having an issue replacing an ! as a character from my record.&amp;nbsp; I want to replace a ! as a [blank].&amp;nbsp; I tried using this statement, but it does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;arcpy.CalculateField_management(CISAddressSDEFL, "NEIGHBOUR", "!NEIGHBOUR!.replace(\"!\", \"\")", "PYTHON", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All other special characters work, but not the !.&amp;nbsp; Any ideas on how to perform a replace?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 21:15:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-how-to-do-a-character-replace-when-an-is/m-p/668673#M51887</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2017-04-03T21:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python - How to do a character replace when an ! is involved</title>
      <link>https://community.esri.com/t5/python-questions/python-how-to-do-a-character-replace-when-an-is/m-p/668674#M51888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured it out, I basically concerted the ! to an ASCI code and it worked.&amp;nbsp; Here is my syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# ! Screening&lt;BR /&gt;arcpy.SelectLayerByAttribute_management(CISAddressSDEFL, "NEW_SELECTION", "NEIGHBOUR LIKE '%!%'")&lt;BR /&gt;explanationPointChar = chr(33)&lt;BR /&gt;arcpy.CalculateField_management(CISAddressSDEFL, "NEIGHBOUR", "!NEIGHBOUR!.replace(explanationPointChar, \"\")", "PYTHON", "")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 21:51:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-how-to-do-a-character-replace-when-an-is/m-p/668674#M51888</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2017-04-03T21:51:59Z</dc:date>
    </item>
  </channel>
</rss>

