<?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 add &amp;quot;text&amp;quot; in attribute table? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596435#M46671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mr Patterson really Helpful...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Oct 2018 15:43:58 GMT</pubDate>
    <dc:creator>RudiniRudini</dc:creator>
    <dc:date>2018-10-26T15:43:58Z</dc:date>
    <item>
      <title>How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596431#M46667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want ask a question about this..&lt;/P&gt;&lt;P&gt;see the attachment about my shp data..&lt;/P&gt;&lt;P&gt;so i have the shp attribute like in the attachment..&lt;/P&gt;&lt;P&gt;i want to fill the "name" field using the formula like: shape_length &amp;lt; 50 = A, 20 &amp;lt; Shape_length &amp;lt; 500 = B and shape_length &amp;gt; 500 = C..&lt;/P&gt;&lt;P&gt;is it possible to do that??&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone help me to explain it?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:59:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596431#M46667</guid>
      <dc:creator>RudiniRudini</dc:creator>
      <dc:date>2018-10-26T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596432#M46668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To do this manually, you'll use Select by Attributes. Select all records where SHAPELENGTH &amp;lt;= 50, then use the Field Calculator to calculate "A" into your text field. Repeat the same workflow modifying your SHAPELENGTH query and using the Field Calculator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 15:34:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596432#M46668</guid>
      <dc:creator>deleted-user-qpvAI3Fo0MKR</dc:creator>
      <dc:date>2018-10-26T15:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596433#M46669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;shape_length &amp;lt; 50 = A, 20 &amp;lt; Shape_length &amp;lt; 500 = B and shape_length &amp;gt; 500 = C.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;your ranges overlap, so I assum you meant&amp;nbsp; 50 &amp;lt; … &amp;lt; 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;python parser, code block below, destination field needs to be string/text.&amp;nbsp; There will be no nulls since it is a shape_length field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;func(!Shape_Length!)&lt;/SPAN&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;func&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;""" parser"""&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;50&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'A'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;500&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'B'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; val&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;/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 01:36:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596433#M46669</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T01:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596434#M46670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply Mr Schwartz&lt;/P&gt;&lt;P&gt;but i want to fill automatically and i just found using VBA script in field calculator with IF statements but i have another trouble with multiple IF statments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i put this code in field calculator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim Name&lt;BR /&gt;if [SHAPE_Length] &amp;lt; 50 then&lt;BR /&gt;Name = "A"&lt;BR /&gt;elseif 50 &amp;lt; [SHAPE_Length] &amp;lt; 1000 then&lt;BR /&gt;Name = "B"&lt;BR /&gt;elseif [SHAPE_Length] &amp;gt; 1000 then&lt;BR /&gt;Name = "C"&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but after it run, the result only take Name &amp;lt; 50 = A, Name &amp;gt;50 = B..&lt;/P&gt;&lt;P&gt;i think i put the wrong code &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 15:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596434#M46670</guid>
      <dc:creator>RudiniRudini</dc:creator>
      <dc:date>2018-10-26T15:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596435#M46671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mr Patterson really Helpful...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 15:43:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596435#M46671</guid>
      <dc:creator>RudiniRudini</dc:creator>
      <dc:date>2018-10-26T15:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596436#M46672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don't use vba&lt;/P&gt;&lt;P&gt;switch to python&lt;/P&gt;&lt;P&gt;I rearranged the logic since a Shape_Length field will never be &amp;lt;null&amp;gt; so you only have to check for &amp;lt; 50 ( ie 'A' ) and &amp;gt; 1000&amp;nbsp; ( ie 'C') then everything else has to be 'B'&lt;/P&gt;&lt;P&gt;your code isn't indented properly... see&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for formatting code blocks for geonet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 15:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596436#M46672</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-26T15:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596437#M46673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mr Patterson,&lt;/P&gt;&lt;P&gt;i tried your code last night, and its still show some error..&amp;nbsp;&lt;/P&gt;&lt;P&gt;i write this in Pre-Logic script code:&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;func&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!SHAPE_Length!&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;""" parser"""&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; !SHAPE_Length! &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;50&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'STA'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; !SHAPE_Length! &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5000&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Center Line'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Row'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; val&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;/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;P&gt;and in below box i write this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name =&amp;nbsp;&lt;/P&gt;&lt;P&gt;func( !SHAPE_Length!)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i keep get the error processing code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where am i wrong??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596437#M46673</guid>
      <dc:creator>RudiniRudini</dc:creator>
      <dc:date>2021-12-12T01:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "text" in attribute table?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596438#M46674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well you changed mine.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure your field you are calculating into is a text field&lt;/LI&gt;&lt;LI&gt;You need to set it to a python parser&lt;/LI&gt;&lt;LI&gt;Your code has no indentation... it must be 4 spaces (not tab) exactly as I have shown&lt;UL&gt;&lt;LI&gt;lines 2, 3, 5, 7 and 9 … 4 spaces indented&lt;/LI&gt;&lt;LI&gt;lines 4, 6 and 8 …. 8 spaces&lt;/LI&gt;&lt;LI&gt;change the !Shape_Length! back to 'a' (no quotes)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;it is &lt;STRONG&gt;func(a)&lt;/STRONG&gt; so it can be a generic function...&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;So I don't have to open up Arc*… the case of the shape_length field is important... it must be exact when you pass it to &lt;STRONG&gt;func( the fieldname within ! marks)&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I think I covered everything, just follow mine..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Oct 2018 10:27:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-quot-text-quot-in-attribute-table/m-p/596438#M46674</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-27T10:27:00Z</dc:date>
    </item>
  </channel>
</rss>

