<?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: Field calculator to update a field using another field in attribute table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372321#M29402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;table is hard to read, but I suspect that you are also having trouble with the other bits, like getting the SEC field which would be&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;sectn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'024'&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"S{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sectn&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;# in field calculator&amp;nbsp; !sectn! with python parser&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or are those ok... it isn't clear whether you need the whole process completed, just some bits, or all the work?&amp;nbsp; And how much python do you know?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:13:41 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T17:13:41Z</dc:date>
    <item>
      <title>Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372319#M29400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following attribute table. I need to update the fields using the field calculator (SEC, TOWN, RANG) by using the "mtrs" and "label" columns(fields) in the attribute table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEC: (letter S + label) &amp;nbsp; TOWN: (string from mtrs) &amp;nbsp; &amp;nbsp;RANGE (string from mtrs) &amp;nbsp; &amp;nbsp; &amp;nbsp;S_R_T (join the SEC+TOWN+RANG)&lt;/P&gt;&lt;P&gt;S24 &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; T1N &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; R14W &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;S24-T1N-R14W &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;&lt;/P&gt;&lt;P&gt;S4 &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; T1N &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; R14W &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;&lt;SPAN&gt;S24-T1N-R14W&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;S34 &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; T2S &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; R8W &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;S34-T2S-R8W&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody help me to achieve this using the "Field Calculator" and Python parser functions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="376493" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/376493_SRT.bmp" style="width: 620px; height: 346px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 16:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372319#M29400</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-10-09T16:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372320#M29401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"{}-{}-{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!A!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !B!&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; !C!&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;just replace A, B and C with your field names but keep the ! ! marks around them.&lt;/P&gt;&lt;P&gt;Obviously , this has to go into a text field and you have to specify python as the o\parserf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 17:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372320#M29401</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-09T17:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372321#M29402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;table is hard to read, but I suspect that you are also having trouble with the other bits, like getting the SEC field which would be&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;sectn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'024'&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"S{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sectn&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;# in field calculator&amp;nbsp; !sectn! with python parser&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or are those ok... it isn't clear whether you need the whole process completed, just some bits, or all the work?&amp;nbsp; And how much python do you know?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:13:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372321#M29402</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T17:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372322#M29403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan. Yes I figured and it worked. I am a beginner to Python.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 21:12:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372322#M29403</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-10-12T21:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372323#M29404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you find an alternate solution or do you want to close the thread?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 20:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372323#M29404</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-20T20:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372324#M29405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies for the late reply. Your answers were very helpful. Is there a way I can extract RANGE using the "mtrs" column?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 21:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372324#M29405</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-10-25T21:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372325#M29406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes... what have you tried and what should it look like?&lt;/P&gt;&lt;P&gt;This type of functionality is simply python &lt;A href="https://docs.python.org/3.6/library/functions.html?highlight=slice#slice"&gt;&lt;STRONG&gt;string slicing&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;other functions&lt;STRONG&gt; &lt;A href="https://docs.python.org/3.6/library/string.html"&gt;string functions&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 21:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372325#M29406</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-25T21:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372326#M29407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;"R{}".format(int(!mtrs![11:13])) but I am not able to get the East "E" or "W" letter attached like R1E or R18W.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 22:00:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372326#M29407</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-10-25T22:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372327#M29408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ahhh... slicing again&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcdefghi__13E'&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;# ---- since you didn't include an example ----&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"R{}{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;13&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;13&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;# x = !mtrs!&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'R13E'&lt;/SPAN&gt;&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>Sat, 11 Dec 2021 17:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372327#M29408</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T17:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372328#M29409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are genius. I got the trick now. Thanks a bunch. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372328#M29409</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-10-26T13:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372329#M29410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dumindu could you select the answer that answered the question to close the thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:05:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372329#M29410</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-26T14:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculator to update a field using another field in attribute table</title>
      <link>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372330#M29411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calculator-to-update-a-field-using-another/m-p/372330#M29411</guid>
      <dc:creator>DuminduJayasekera</dc:creator>
      <dc:date>2017-10-26T14:15:24Z</dc:date>
    </item>
  </channel>
</rss>

