<?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: Help with field calculator. Adding text to end of existing text in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85904#M59078</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/231617-string-or-binary-data-would-be-truncated-error"&gt;https://community.esri.com/thread/231617-string-or-binary-data-would-be-truncated-error&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked up the error. I guess the field length in my case was too short (255 length). I tried this same expression on a field with a length of 1600 and it was successful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Nov 2020 16:17:27 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2020-11-10T16:17:27Z</dc:date>
    <item>
      <title>Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85897#M59071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I have a column in a large attribute table. The values in this column are text. &lt;/P&gt;&lt;P&gt;Example entries in this case would be:&lt;/P&gt;&lt;P&gt;Bas&lt;/P&gt;&lt;P&gt;Rh&lt;/P&gt;&lt;P&gt;Pega&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I add the word 'Log' to the end of each entry so it'd look like:&lt;/P&gt;&lt;P&gt;BasLog&lt;/P&gt;&lt;P&gt;RhLog&lt;/P&gt;&lt;P&gt;PegaLog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want to use the technique or sorting them, then selecting them, then using field calculator to define them. I just want to know how to add text onto existing text, no matter what the existing text is.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 13:12:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85897#M59071</guid>
      <dc:creator>TheoFaull</dc:creator>
      <dc:date>2015-01-15T13:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85898#M59072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Theo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open the field calculator, right click the field you would like to add text and click "Field Calculator". Lets call this field FIELD.&lt;/P&gt;&lt;P&gt;then type the following in your field calculator:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[FIELD] + "Log"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 13:25:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85898#M59072</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-01-15T13:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85899#M59073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Theo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Field Calculator is the way to do this but you will need to check the code block option and input a rather simple function. Below I've provided steps using Python which I'm more familiar with:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Open the attribute table and right click on column you need to update&lt;/LI&gt;&lt;LI&gt;Select Field Calculator (You can run this outside an edit session but will not be able to undo the update)&lt;/LI&gt;&lt;LI&gt;Select the Python parser option&lt;/LI&gt;&lt;LI&gt;For Type, select String&lt;/LI&gt;&lt;LI&gt;Check Show Codeblock&lt;/LI&gt;&lt;LI&gt;In the Pre-logic Script Code text box, build a function similar to the one below:&lt;OL&gt;&lt;LI&gt;def replaceStr(string):&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; newString = string.replace(string, string + "LOG")&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; return newString&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;In field text box, call the function you created in the Pre-logic Script Code text box, but pass in your actual column name (i.e. replaceStr(!FIELD_NAME!)&lt;/LI&gt;&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;When defining the function, be sure to use two spaces for each subsequent line under the function definition line (def replaceStr(string):) otherwise an error will be returned. The .replace() is the method used to append additional text to your input string field. I hope this helps and isn't too long winded for you &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 13:47:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85899#M59073</guid>
      <dc:creator>AndyOmmen</dc:creator>
      <dc:date>2015-01-15T13:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85900#M59074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks guys, i will try both techniques and report back!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: ok so I found Tim's solution was easiest and it worked fine for me. Although I didn't try Andy's, thanks anyway! &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, 15 Jan 2015 13:50:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85900#M59074</guid>
      <dc:creator>TheoFaull</dc:creator>
      <dc:date>2015-01-15T13:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85901#M59075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:49:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85901#M59075</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-01-15T15:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85902#M59076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To follow on from Tim's ... for Pythonista's and those moving on to Arc* 10.3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python parser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;!FieldnameHere! + "log"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # python uses ! to surround fields instead of [ ... ]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 16:14:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85902#M59076</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-01-15T16:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85903#M59077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using ArcGIS Pro 2.6. I want to add some text to an existing field. The following verifies as valid but throws an error:&lt;BR /&gt;&lt;IMG __jive_id="513015" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/513015_pastedImage_2.png" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="513016" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/513016_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 15:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85903#M59077</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2020-11-10T15:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with field calculator. Adding text to end of existing text</title>
      <link>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85904#M59078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/231617-string-or-binary-data-would-be-truncated-error"&gt;https://community.esri.com/thread/231617-string-or-binary-data-would-be-truncated-error&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked up the error. I guess the field length in my case was too short (255 length). I tried this same expression on a field with a length of 1600 and it was successful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2020 16:17:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-field-calculator-adding-text-to-end-of/m-p/85904#M59078</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2020-11-10T16:17:27Z</dc:date>
    </item>
  </channel>
</rss>

