<?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: How to remove spaces with Calculate field in ArcCatalog Model in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300505#M23256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you enter that in model builder?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What&amp;nbsp; about fields from SDE with fully qualified names&amp;nbsp; [owner].[feature class].[field]&amp;nbsp; how do you use the replace in this case?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Dec 2010 00:24:31 GMT</pubDate>
    <dc:creator>JoseSanchez</dc:creator>
    <dc:date>2010-12-02T00:24:31Z</dc:date>
    <item>
      <title>How to remove spaces with Calculate field in ArcCatalog Model</title>
      <link>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300503#M23254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to remove spaces from a string using model builder in ArcCatalog and I wrote the following in the Calculate Field, field experssion:&amp;nbsp; !W.TCIS_GIS.PREM_TYPE!.strip() &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It shows the following error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Calculate Field): CalculateField PremisePoints_Layer PremisePoints.PREMTYPE " !WASD.TCIS_GIS.PREM_TYPE!.strip() " PYTHON # PremisePoints_Layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Wed Dec 01 15:37:55 2010&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression:&amp;nbsp; "TWNHOUSE".strip()&amp;nbsp; &amp;lt;type 'exceptions.IndentationError'&amp;gt;: unexpected indent (&amp;lt;string&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Item not found in this collection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Calculate Field).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Time: Wed Dec 01 15:38:00 2010 (Elapsed Time: 5.00 seconds)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 18:43:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300503#M23254</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2010-12-01T18:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove spaces with Calculate field in ArcCatalog Model</title>
      <link>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300504#M23255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I'm using the Calculate Field function to replace things I normally just use&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Replace([Field_Name], "remove item", "replace item")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;seems to work well for me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 19:13:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300504#M23255</guid>
      <dc:creator>NolanGeise</dc:creator>
      <dc:date>2010-12-01T19:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove spaces with Calculate field in ArcCatalog Model</title>
      <link>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300505#M23256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you enter that in model builder?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What&amp;nbsp; about fields from SDE with fully qualified names&amp;nbsp; [owner].[feature class].[field]&amp;nbsp; how do you use the replace in this case?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 00:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300505#M23256</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2010-12-02T00:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove spaces with Calculate field in ArcCatalog Model</title>
      <link>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300506#M23257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would just input a generic string like Replace([Field_Name], "Out", "In") in the tool within ModelBuilder and then set the expression as a model parameter as well as the input table and field, that way you have the flexibility of changing your inputs when you run the model. If it is the exact same expression (field name and all) every time you could just enter the correct expression into the tool in ModelBuilder and not set it as a model parameter. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The other stuff you're talking about is not something I would not be comfortable answering. I would think that as long as the field names are the same in the expression as they are in the table it should work but that kind of logic doesn't alway pan out with Arc, at least not for me.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 11:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-remove-spaces-with-calculate-field-in/m-p/300506#M23257</guid>
      <dc:creator>NolanGeise</dc:creator>
      <dc:date>2010-12-02T11:02:50Z</dc:date>
    </item>
  </channel>
</rss>

