<?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: Remove Empty Spaces with Field Calculator  in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671391#M22322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;#---- snag the fat-fingered space placer ---&lt;BR /&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" &amp;nbsp;&amp;nbsp; "&lt;/SPAN&gt;&lt;BR /&gt;a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;BR /&gt;Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;‍‍‍‍&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Aug 2017 18:05:11 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-08-01T18:05:11Z</dc:date>
    <item>
      <title>Remove Empty Spaces with Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671389#M22320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a fields that is populated with correct values, &amp;lt;Null&amp;gt;, and whitespace/empty. The field is of text value with both numbers and letters in the correct values. I want to remove all of the whitespace/empty and replace them with &amp;lt;Null&amp;gt; instead. I am trying to do this with the field calculator and python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current prelogic statement is:&lt;/P&gt;&lt;P&gt;def makeNull(unitType):&lt;BR /&gt;&amp;nbsp; if unitType == str():&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return None&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the box below is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;makeNull( !UnitType!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However when the field is calculated it turns all of the values to &amp;lt;Null&amp;gt; instead of just the whitespace/empty. Any Idea what I am doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 16:18:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671389#M22320</guid>
      <dc:creator>NickArcher</dc:creator>
      <dc:date>2017-08-01T16:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Empty Spaces with Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671390#M22321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you only try evaluating empty strings.&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;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;makeNull&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;unitType&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; unitType &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; None
&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; unitType‍‍‍‍‍&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:19:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671390#M22321</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-12T04:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Empty Spaces with Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671391#M22322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;#---- snag the fat-fingered space placer ---&lt;BR /&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" &amp;nbsp;&amp;nbsp; "&lt;/SPAN&gt;&lt;BR /&gt;a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;BR /&gt;Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;‍‍‍‍&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671391#M22322</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-08-01T18:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Empty Spaces with Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671392#M22323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the problem was I didn't have a else statement. I added in your else statement and it worked. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/remove-empty-spaces-with-field-calculator/m-p/671392#M22323</guid>
      <dc:creator>NickArcher</dc:creator>
      <dc:date>2017-08-01T18:12:52Z</dc:date>
    </item>
  </channel>
</rss>

