<?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: EOL calculating field, single quoted - scrubbing addresses in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569926#M44682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I tried that and here is what I got:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP44\49053 situs batch errors&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Documents and Settings\Andrew\Desktop\Copy of HOUSENUMERZERO.py", lin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e 18, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CalculateField_management(fc + "\\Parcels.shp", "SIT_FULL_S", "myfunction&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(!SIT_HSE_NU!,\"\"!SIT_FULL_S!\"\")", "PYTHON", "def myfunction(fld1,fld2):\n if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; (fld1=='0'or fld1=='00'or fld1&amp;lt;'00000000000'):\n return ''\n else:\n&amp;nbsp;&amp;nbsp; return f&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ld2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000989: Python syntax error: Parsing error &amp;lt;type 'exceptions.IndentationEr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ror'&amp;gt;: expected an indented block (line 3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 May 2011 16:22:56 GMT</pubDate>
    <dc:creator>TurnerNowak</dc:creator>
    <dc:date>2011-05-10T16:22:56Z</dc:date>
    <item>
      <title>EOL calculating field, single quoted - scrubbing addresses</title>
      <link>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569924#M44680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Would anyone be able to point me in the right direction ?&amp;nbsp; I need to figure out how to either make the script ignore these errors and continue to run, or actually be able to handle these lines that currently shut down the script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4&amp;gt;call housenumberzero.bat &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4&amp;gt;C:\Python24\HOUSENUMERZERO.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4\49003&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4\49053&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python24\HOUSENUMERZERO.py", line 21, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CalculateField_management(fc + "\\Parcels.shp", "SIT_FULL_S", "myfunction(!SIT_HSE_NU!,!SIT_FULL_S!)", "PYTHON", "def myfunction(fld1,fld2):\n&amp;nbsp; if (fld1=='0'or fld1=='00'or fld1&amp;lt;'00000000000'):\n&amp;nbsp;&amp;nbsp;&amp;nbsp; return ''\n&amp;nbsp; else:\n&amp;nbsp;&amp;nbsp;&amp;nbsp; return fld2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: ERROR 000539: Error running expression: myfunction("69","69 FLOOD ST&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;") &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: EOL while scanning single-quoted string (&amp;lt;string&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4&amp;gt;call 1LowerCaseSitusFull.bat &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4&amp;gt;C:\Python24\SITUSLOWERPYTON.py&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4\49003&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP4\49053&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python24\SITUSLOWERPYTON.py", line 17, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CalculateField_management(fc + "\\Parcels.shp", "SIT_FULL_S", "!SIT_FULL_S!.title()", "PYTHON", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: ERROR 000539: Error running expression: "69 FLOOD ST&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;".title() &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: EOL while scanning single-quoted string (&amp;lt;string&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 15:35:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569924#M44680</guid>
      <dc:creator>TurnerNowak</dc:creator>
      <dc:date>2011-05-10T15:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: EOL calculating field, single quoted - scrubbing addresses</title>
      <link>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569925#M44681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;gp.CalculateField_management(fc + "\\Parcels.shp", "SIT_FULL_S", "myfunction(!SIT_HSE_NU!,\"\"!SIT_FULL_S!\"\")", "PYTHON", "def myfunction(fld1,fld2):\n if (fld1=='0'or fld1=='00'or fld1&amp;lt;'00000000000'):\n return ''\n else:\n return fld2")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569925#M44681</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2021-12-12T00:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: EOL calculating field, single quoted - scrubbing addresses</title>
      <link>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569926#M44682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I tried that and here is what I got:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\ZP44\49053 situs batch errors&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Documents and Settings\Andrew\Desktop\Copy of HOUSENUMERZERO.py", lin&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e 18, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CalculateField_management(fc + "\\Parcels.shp", "SIT_FULL_S", "myfunction&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(!SIT_HSE_NU!,\"\"!SIT_FULL_S!\"\")", "PYTHON", "def myfunction(fld1,fld2):\n if&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; (fld1=='0'or fld1=='00'or fld1&amp;lt;'00000000000'):\n return ''\n else:\n&amp;nbsp;&amp;nbsp; return f&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ld2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000989: Python syntax error: Parsing error &amp;lt;type 'exceptions.IndentationEr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ror'&amp;gt;: expected an indented block (line 3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 16:22:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569926#M44682</guid>
      <dc:creator>TurnerNowak</dc:creator>
      <dc:date>2011-05-10T16:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: EOL calculating field, single quoted - scrubbing addresses</title>
      <link>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569927#M44683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Missing indentation in your function block's return statements:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;"def myfunction(fld1,fld2):\n if (fld1=='0'or fld1=='00'or fld1&amp;lt;'00000000000'):\n&amp;nbsp;&amp;nbsp; return ''\n else:\n&amp;nbsp;&amp;nbsp; return fld2"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 20:16:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569927#M44683</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-05-10T20:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: EOL calculating field, single quoted - scrubbing addresses</title>
      <link>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569928#M44684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Missing indentation in your function block's return statements:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;"def myfunction(fld1,fld2):\n if (fld1=='0'or fld1=='00'or fld1&amp;lt;'00000000000'):\n&amp;nbsp;&amp;nbsp; return ''\n else:\n&amp;nbsp;&amp;nbsp; return fld2"&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, I tried the above indentation but got this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Documents and Settings\Andrew\Desktop\HOUSENUMERZERO.py", line 18, in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression: myfunction&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(" ","69 FLOOD ST&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;") &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: EOL while scanning single-quoted string (&amp;lt;st&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ring&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2011 16:38:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/eol-calculating-field-single-quoted-scrubbing/m-p/569928#M44684</guid>
      <dc:creator>TurnerNowak</dc:creator>
      <dc:date>2011-05-11T16:38:54Z</dc:date>
    </item>
  </channel>
</rss>

