<?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: replace alphabet with Arcpy in ArcMap in ArcMap Questions</title>
    <link>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138632#M3402</link>
    <description>&lt;P&gt;In Field Calculator, I used VB Script Parser with a similar expression.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Replace(Replace(Replace( [SplitF],"a","ش " ), "d","ي"), "s","س")&lt;/LI-CODE&gt;&lt;P&gt;The result looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JayantaPoddar_0-1643453340733.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/32660i32D6E3B9A86BE63B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JayantaPoddar_0-1643453340733.png" alt="JayantaPoddar_0-1643453340733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is the above output correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jan 2022 10:52:27 GMT</pubDate>
    <dc:creator>JayantaPoddar</dc:creator>
    <dc:date>2022-01-29T10:52:27Z</dc:date>
    <item>
      <title>replace alphabet with Arcpy in ArcMap</title>
      <link>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138622#M3401</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Dears I am trying to replace text in a field, I want to rematch English alphabet into Arabic alphabet like (a = ش, d = ي, s = س, etc...). I wrote a test script for 2 characters and run it in ArcMap 10.8 python window, it doesn't works well as it is work with English alphabet:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Moelsaket_1-1643442991157.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/32653i9A072003D03BDEF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Moelsaket_1-1643442991157.png" alt="Moelsaket_1-1643442991157.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;here's my script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;###script for arabic
fc = r"C:/New File Geodatabase.gdb/an3"
cursor = arcpy.da.UpdateCursor(fc, ["name1"])
for row in cursor:
      if "a" in row[0]:
            row[0] = row[0].encode('utf8').replace("a", "ض")
      if "s" in row[0]:
            row[0] = row[0].encode('utf8').replace("s", "س")
      cursor.updateRow(row)&lt;/PRE&gt;&lt;P&gt;dears i'm trying to replace text in field, i want to rematch English alphabet to Arabic alphabet like (a = ش, d = ي, s = س, etc...). I wrote a test script for 2 characters and run it in ArcMap 10.8 python window, it doesn't works well as it is work with English alphabet: here's my script: my data&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://i.stack.imgur.com/gZnaL.png" target="_blank" rel="nofollow noopener noreferrer"&gt;enter image description here&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;###script for arabic
fc = r"C:/New File Geodatabase.gdb/an3"
cursor = arcpy.da.UpdateCursor(fc, ["name1"])
for row in cursor:
      if "a" in row[0]:
            row[0] = row[0].encode('utf8').replace("a", "ض")
      if "s" in row[0]:
            row[0] = row[0].encode('utf8').replace("s", "س")
      cursor.updateRow(row)&lt;/PRE&gt;&lt;P&gt;Output/result&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Moelsaket_2-1643443063757.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/32654i17A293C93669B116/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Moelsaket_2-1643443063757.png" alt="Moelsaket_2-1643443063757.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;test script with English alphabet instead of Arabic on the same data:&lt;/P&gt;&lt;PRE&gt;fc = r"C:/New File Geodatabase.gdb/an3"
cursor = arcpy.da.UpdateCursor(fc, ["name1"])
for row in cursor:
      if "a" in row[0]:
         row[0] = row[0].encode('utf').replace("a", "Q")
      if "s" in row[0]:
         row[0] = row[0].encode('utf').replace("s", "H")
      cursor.updateRow(row)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Output:&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Moelsaket_3-1643443130062.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/32655iFC20FDA621C50E8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Moelsaket_3-1643443130062.png" alt="Moelsaket_3-1643443130062.png" /&gt;&lt;/span&gt;&lt;P&gt;it works fine with all&amp;nbsp;characters in all cells.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-----------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 29 Jan 2022 07:59:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138622#M3401</guid>
      <dc:creator>DasheEbra</dc:creator>
      <dc:date>2022-01-29T07:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: replace alphabet with Arcpy in ArcMap</title>
      <link>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138632#M3402</link>
      <description>&lt;P&gt;In Field Calculator, I used VB Script Parser with a similar expression.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Replace(Replace(Replace( [SplitF],"a","ش " ), "d","ي"), "s","س")&lt;/LI-CODE&gt;&lt;P&gt;The result looks like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JayantaPoddar_0-1643453340733.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/32660i32D6E3B9A86BE63B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JayantaPoddar_0-1643453340733.png" alt="JayantaPoddar_0-1643453340733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is the above output correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jan 2022 10:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138632#M3402</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2022-01-29T10:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: replace alphabet with Arcpy in ArcMap</title>
      <link>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138854#M3415</link>
      <description>&lt;P&gt;I did not do this for a language but as a spell check.&lt;/P&gt;&lt;P&gt;What I would suggest is creating a look up table with the English Character in one column and the Arabic character in the second column.&amp;nbsp; Then create your script to to a find and replace&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 13:11:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcmap-questions/replace-alphabet-with-arcpy-in-arcmap/m-p/1138854#M3415</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2022-01-31T13:11:27Z</dc:date>
    </item>
  </channel>
</rss>

