<?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: Strip symbol from table or fc in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94907#M7396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;How do make an exception for the None Type with my current code?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will skip the null fields and hopefully solve your problem.&lt;/P&gt;&lt;P&gt;Note, using arcpy.da.UpdateCursor may be 10-100x faster, making your question about the query table maybe not that important...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;with arcpy.da.UpdateCursor(fc, "Name") as rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for r in rows:&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if r != None:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r[0] = r[0].replace("$", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(r)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 23:37:31 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2021-12-10T23:37:31Z</dc:date>
    <item>
      <title>Strip symbol from table or fc</title>
      <link>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94903#M7392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I am trying to strip "$" from attributes in the Name field or all the fields in a feature class table prior to exporting out the table.&lt;/P&gt;&lt;P&gt;Could you strip the "$" from attributes in the Name field or all the fields in arcpy.MakeQueryTable_management prior to exporting if so how? I am not sure which would be the fastest?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following but i am getting an error on line 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;line 8, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; r.OwnerName = s.strip("$")&lt;/P&gt;&lt;P&gt;AttributeError: 'NoneType' object has no attribute 'strip'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy


fc = "C:/Temp/Default.gdb/yogurt"


rows = arcpy.UpdateCursor(fc)&amp;nbsp; 
for r in rows:&amp;nbsp; 
&amp;nbsp; s = r.Name&amp;nbsp; 
&amp;nbsp; r.Name = s.strip("$")&amp;nbsp;&amp;nbsp; 
&amp;nbsp; rows.updateRow(r) &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94903#M7392</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2021-12-10T23:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Strip symbol from table or fc</title>
      <link>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94904#M7393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;r.Name = s.replace("$","")&lt;/P&gt;&lt;P&gt;but a None Type means you have blanks returning None&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS where did r.Ownername come from???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2016 22:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94904#M7393</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-10T22:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Strip symbol from table or fc</title>
      <link>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94905#M7394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the r.OwnerName is a typo, it should have just been r.name = &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;s.strip("$"), my bad.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;How do make an exception for the None Type with my current code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Can the $ be striped from a arcpy.MakeQueryTable_management?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 15:34:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94905#M7394</guid>
      <dc:creator>CCWeedcontrol</dc:creator>
      <dc:date>2016-05-11T15:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Strip symbol from table or fc</title>
      <link>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94906#M7395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course it can... assuming one could see the whole code section&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 17:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94906#M7395</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-11T17:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Strip symbol from table or fc</title>
      <link>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94907#M7396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;How do make an exception for the None Type with my current code?&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This will skip the null fields and hopefully solve your problem.&lt;/P&gt;&lt;P&gt;Note, using arcpy.da.UpdateCursor may be 10-100x faster, making your question about the query table maybe not that important...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;with arcpy.da.UpdateCursor(fc, "Name") as rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for r in rows:&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if r != None:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r[0] = r[0].replace("$", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(r)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:37:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/strip-symbol-from-table-or-fc/m-p/94907#M7396</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-10T23:37:31Z</dc:date>
    </item>
  </channel>
</rss>

