<?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: Arcpy - delete attribute data if string starts with.. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74299#M6087</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;Charlie Frye wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks Ian--I've been writing VBA lately...&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;An Esri staffer writing VBA?&amp;nbsp; Isn't that sacrilegious these days seeing that Esri deprecated VBA in 10.1 and has been trying unsuccessfully to retire it since then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Aug 2014 18:13:58 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2014-08-19T18:13:58Z</dc:date>
    <item>
      <title>Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74290#M6078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what I'm trying to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a shapefile called 'Roster' with an attribute table like the one below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #c6c6c6; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;NAME&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Room&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;***John&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;23&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;***Alice&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;56&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;Tina&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;34&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to search the shapefile and delete any data under the field 'NAME' where the string starts with '***'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The resulting table would look like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #c6c6c6; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;NAME&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Age&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;Room&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;23&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;56&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;Tina&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;34&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured out how to replace the '***' string with another string, but I can't figure out how to delete the entire cell....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1408396166656391 jive_text_macro" jivemacro_uid="_1408396166656391"&gt;
&lt;P&gt;def removeName(shapefilePath):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cursor = arcpy.da.UpdateCursor(shapefilePath, ["NAME"]) &lt;/P&gt;
&lt;P&gt;&amp;nbsp; for row in cursor: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = row[0].replace("***", None)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; del row&lt;/P&gt;
&lt;P&gt;&amp;nbsp; del cursor&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 21:12:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74290#M6078</guid>
      <dc:creator>AliciaSoto</dc:creator>
      <dc:date>2014-08-18T21:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74291#M6079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Replace the contents of the for block with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nameStr = row[0]&lt;/P&gt;&lt;P&gt;if nameStr[0:3] == "***" then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; newName = nameStr.replace("***", None)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; row[0] = newName &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; cursor.update(row)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 21:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74291#M6079</guid>
      <dc:creator>CharlieFrye</dc:creator>
      <dc:date>2014-08-18T21:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74292#M6080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;nameStr = row[0]&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;if nameStr[0:3] == "***" then:&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; # This is if you wanted to just strip the ***&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; newName = nameStr.replace("***", None)&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; row[0] = newName&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; # set the string to nothing&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; row[0] = ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; cursor.update(row)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 21:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74292#M6080</guid>
      <dc:creator>CharlieFrye</dc:creator>
      <dc:date>2014-08-18T21:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74293#M6081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need for the then Charlie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 21:43:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74293#M6081</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-08-18T21:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74294#M6082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14083984359488375" jivemacro_uid="_14083984359488375"&gt;
&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14083984885553644" jivemacro_uid="_14083984885553644"&gt;
&lt;P&gt;&lt;SPAN class="keyword"&gt;def removeName(shapefilePath):&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="keyword"&gt;&lt;/SPAN&gt;&amp;nbsp; cursor = arcpy.da.UpdateCursor(shapefilePath, [&lt;SPAN class="string"&gt;"NAME"])&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="keyword"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; cursor:&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameStr = row[0]&lt;/P&gt;


&lt;/PRE&gt;
&lt;/PRE&gt;&lt;DIV class="js-thread-post-wrapper j-thread-post-wrapper j-rc4 jive-content"&gt;&lt;DIV class="j-thread-post j-rc4"&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameStr[0:3] == "***" :&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = ""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.update(row)&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 21:47:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74294#M6082</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-08-18T21:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74295#M6083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code worked once I changed cursor.update(row) to cursor.updateRow(row)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the final code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14083995461904783" jivemacro_uid="_14083995461904783" modifiedtitle="true"&gt;
&lt;P&gt;def removeName(shapefilePath):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cursor = arcpy.da.UpdateCursor(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;shapefilePath&lt;/SPAN&gt;, ["NAME"])&lt;/P&gt;
&lt;P&gt;&amp;nbsp; for row in cursor:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameStr = row[0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if nameStr[0:3] == "***":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; del row&lt;/P&gt;
&lt;P&gt;&amp;nbsp; del cursor&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 22:07:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74295#M6083</guid>
      <dc:creator>AliciaSoto</dc:creator>
      <dc:date>2014-08-18T22:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74296#M6084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ian--I've been writing VBA lately...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2014 22:27:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74296#M6084</guid>
      <dc:creator>CharlieFrye</dc:creator>
      <dc:date>2014-08-18T22:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74297#M6085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured it was something like that Charlie, no worries&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 14:02:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74297#M6085</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-08-19T14:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74298#M6086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another way to see if the name starts with ***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14084714757042600 jive_text_macro" jivemacro_uid="_14084714757042600"&gt;
&lt;P&gt;def removeName(shapefilePath):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cursor = arcpy.da.UpdateCursor(shapefilePath, ["NAME"])&lt;/P&gt;
&lt;P&gt;&amp;nbsp; for row in cursor:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nameStr = row[0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="color: #e23d39;"&gt; if nameStr.startswith("***"):&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = ""&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; del row&lt;/P&gt;
&lt;P&gt;&amp;nbsp; del cursor&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;R_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 18:04:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74298#M6086</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2014-08-19T18:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74299#M6087</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;Charlie Frye wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks Ian--I've been writing VBA lately...&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;An Esri staffer writing VBA?&amp;nbsp; Isn't that sacrilegious these days seeing that Esri deprecated VBA in 10.1 and has been trying unsuccessfully to retire it since then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 18:13:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74299#M6087</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-08-19T18:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - delete attribute data if string starts with..</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74300#M6088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I am thinking the UpdateCursor (arcpy.da) might still be faster, one could also use Make Feature Layer or Select Layer By Attribute followed by Calculate Field.&amp;nbsp; My preference is usually arcpy, but there are other geoprocessing ways of accomplishing the same task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14084771412534513" jivemacro_uid="_14084771412534513"&gt;
&lt;P&gt;def removeName(shapefilePath):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(shapefilePath, "shapefileLayer",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' "NAME" LIKE \'***%\' ')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("shapefileLayer", "NAME", "str()", "PYTHON_9.3")&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 19:39:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-delete-attribute-data-if-string-starts-with/m-p/74300#M6088</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-08-19T19:39:11Z</dc:date>
    </item>
  </channel>
</rss>

