<?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 building script for multiple replacements in field  in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/983#M50</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My screenshots are being moderated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2017 20:35:13 GMT</pubDate>
    <dc:creator>MelissaTrascher</dc:creator>
    <dc:date>2017-12-07T20:35:13Z</dc:date>
    <item>
      <title>Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/975#M42</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a field that has multiple names for the same company, for several companies.&amp;nbsp; I would like to build a script to replace the name for each company...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example: replace( [OPERATOR],"ANADARKO E &amp;amp; P ONSHORE LLC","ANADARKO")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE width="463"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="289"&gt;Find&lt;/TD&gt;&lt;TD width="174"&gt;Replace&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ANADARKO E &amp;amp; P ONSHORE LLC&lt;/TD&gt;&lt;TD&gt;ANADARKO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ANADARKO E&amp;amp;P ONSHORE&lt;/TD&gt;&lt;TD&gt;ANADARKO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ANADARKO PET&lt;/TD&gt;&lt;TD&gt;ANADARKO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ANADARKO PET CORP&lt;/TD&gt;&lt;TD&gt;ANADARKO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ANADARKO PETROLEUM CORPORATION&lt;/TD&gt;&lt;TD&gt;ANADARKO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CHESAPEAKE LIMITED PARTNERSHIP&lt;/TD&gt;&lt;TD&gt;CHESAPEAKE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CHESAPEAKE OPERATING INC.&lt;/TD&gt;&lt;TD&gt;CHESAPEAKE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CHESAPEAKE OPERATING INCORPORATED&lt;/TD&gt;&lt;TD&gt;CHESAPEAKE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CHESAPEAKE OPERATING, INC.&lt;/TD&gt;&lt;TD&gt;CHESAPEAKE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CHESAPEAKE OPERG INC&lt;/TD&gt;&lt;TD&gt;CHESAPEAKE&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I build a single script for all replacements?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 18:45:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/975#M42</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-07T18:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/976#M43</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tagging &lt;A href="https://community.esri.com/community/developers/gis-developers/python?sr=search&amp;amp;searchId=7b113f9c-5599-4474-b879-ab8c86c4c6fb&amp;amp;searchIndex=3"&gt;https://community.esri.com/community/developers/gis-developers/python?sr=search&amp;amp;searchId=7b113f9c-5599-4474-b879-ab8c86c4c6fb&amp;amp;searchIndex=3&lt;/A&gt;‌ since I assume you are wanting this in a python script (if not, make sure to specify what you want the script to be written in, or ifyou are just trying in the field calculator box)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 19:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/976#M43</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-12-07T19:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/977#M44</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following should work.&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="comment token"&gt;#complete path to .shp or feature class&lt;/SPAN&gt;
dataset &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'path_to_dataset'&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dataset&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OPERATOR'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ANADARKO'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ANADARKO'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CHESAPEAKE'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#use same elif loop for more companies&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CHESAPEAKE'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor&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;/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>Fri, 10 Dec 2021 20:03:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/977#M44</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2021-12-10T20:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/978#M45</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Melissa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this using the Field Calculator.&amp;nbsp; Here is the code:&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;calc&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ANADARKO'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'ANADARKO'&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CHESAPEAKE'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'CHESAPEAKE'&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;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="389794" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/389794_Screen1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;!Company! is the field name you are updating.&amp;nbsp; In this case, the field is called &lt;STRONG&gt;Company&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:03:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/978#M45</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T20:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/979#M46</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp; I am still having issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 20:22:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/979#M46</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-07T20:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/980#M47</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have indentation issues or anything...&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the exact error message?&lt;/P&gt;&lt;P&gt;perhaps you can copy and paste the field calculator expression you are using or at least provide a screen grab.&lt;/P&gt;&lt;P&gt;Maybe &lt;A href="https://community.esri.com/people/jskinner-esristaff"&gt;jskinner-esristaff&lt;/A&gt;‌ could do the same with his expression and attach it as a *.cal file to obviate any indentation/copy issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 20:26:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/980#M47</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-07T20:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/981#M48</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;CorrectNames&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NADARKO E &amp;amp; P ONSHORE LLC"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ANADARKO"&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; &lt;SPAN class="string token"&gt;"ANADARKO E&amp;amp;P ONSHORE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ANADARKO"&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; &lt;SPAN class="string token"&gt;"ANADARKO PET"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ANADARKO"&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; &lt;SPAN class="string token"&gt;"ANADARKO PET CORP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ANADARKO"&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; &lt;SPAN class="string token"&gt;"ANADARKO PETROLEUM CORPORATION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ANADARKO"&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; &lt;SPAN class="string token"&gt;"CHESAPEAKE LIMITED PARTNERSHIP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CHESAPEAKE"&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; &lt;SPAN class="string token"&gt;"CHESAPEAKE OPERATING INC."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CHESAPEAKE"&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; &lt;SPAN class="string token"&gt;"CHESAPEAKE OPERATING INCORPORATED"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CHESAPEAKE"&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; &lt;SPAN class="string token"&gt;"CHESAPEAKE OPERATING, INC."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CHESAPEAKE"&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; &lt;SPAN class="string token"&gt;"CHESAPEAKE OPERG INC"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CHESAPEAKE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; dct&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; dct&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;]&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;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; name&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;/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;&lt;/P&gt;&lt;P&gt;I would use a dictionary...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:03:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/981#M48</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-10T20:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/982#M49</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;def calc( !OPERATOR! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; if 'ANADARKO' in field:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 'ANADARKO'&lt;BR /&gt;&amp;nbsp; elif 'CHESAPEAKE' in field:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 'CHESAPEAKE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;calc( !OPERATOR!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 20:34:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/982#M49</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-07T20:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/983#M50</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My screenshots are being moderated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 20:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/983#M50</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-07T20:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/984#M51</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;change this&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;"&gt;def calc( !OPERATOR! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&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;"&gt;to&amp;nbsp;&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;"&gt;def calc( field):&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 20:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/984#M51</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-07T20:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/985#M52</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;def calc(field):&lt;BR /&gt;&amp;nbsp; if 'ANADARKO' in field:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 'ANADARKO'&lt;BR /&gt;&amp;nbsp; elif 'CHESAPEAKE' in field:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 'CHESAPEAKE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPERATOR=&lt;/P&gt;&lt;P&gt;calc( !OPERATOR!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 21:59:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/985#M52</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-07T21:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/986#M53</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still failed. I am having no luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 21:59:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/986#M53</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-07T21:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/987#M54</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it appears you are trying to calculate values for an 'OPERATOR' field... if so, you can't use values that are already in that field.&amp;nbsp; You need to make a new field of the same data type... say ... 'NEW_OP'... then you make that field active and use the calculator expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cal(!NEW_OP!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;of course this assumes that your indentation is totally correct etc etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 22:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/987#M54</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-07T22:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/988#M55</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Melissa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you upload a zipped sample of your data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 12:37:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/988#M55</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2017-12-08T12:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/989#M56</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry, I'm new here - where do I go to upload data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 15:04:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/989#M56</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-08T15:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/990#M57</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When replying click on Use Advanced Editor at the top right:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/390314_Screen1.PNG" style="width: 620px; height: 177px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you will see the Attach option in the lower left hand corner:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/390315_Screen2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 16:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/990#M57</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2017-12-08T16:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/991#M58</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the data I am struggling with. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 17:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/991#M58</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-08T17:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/992#M59</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I had to reply to original message to see the advanced option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 17:33:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/992#M59</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-08T17:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/993#M60</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try the suggestion&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/206396-help-with-building-script-for-multiple-replacements-in-field#comment-734793"&gt;https://community.esri.com/thread/206396-help-with-building-script-for-multiple-replacements-in-field#comment-734793&lt;/A&gt; because your haven't clarified the name of the field you have the data in and whether or not you are trying to add this to a field of the correct type.&amp;nbsp; You calculator expression was incorrect as it was posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, it appears to have been answered... so what was the solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 17:41:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/993#M60</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-12-08T17:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with building script for multiple replacements in field</title>
      <link>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/994#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did try it.&amp;nbsp; I added a text field named it NewOp, selected it, then ran field calc.&amp;nbsp; It didn't work.&amp;nbsp; Its time I took a scripting class... the basics are not working in my new job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't report that this was answered... unless it was by accident when trying to find the advanced editor. Ugh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Dec 2017 18:17:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/help-with-building-script-for-multiple/m-p/994#M61</guid>
      <dc:creator>MelissaTrascher</dc:creator>
      <dc:date>2017-12-08T18:17:11Z</dc:date>
    </item>
  </channel>
</rss>

