<?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: Using &amp;quot; instead of inches in a field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573752#M44963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not quite the same... but "unicode" is quite a large world to fully explore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;dq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;"\u201D"&lt;/SPAN&gt;

f&lt;SPAN class="string token"&gt;"quoting{dq}"&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'quoting”'&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"quoting{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dq&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'quoting”'&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;/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 00:41:59 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-12T00:41:59Z</dc:date>
    <item>
      <title>Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573748#M44959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, I am trying to calculate a field to read 2" HDPE in every row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;#Calculate field Conduit feature class Underground
&lt;/SPAN&gt;arcpy.CalculateField_management(&lt;SPAN style="color: #6a8759;"&gt;"Underground.dbf"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Conduit"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'"2in HDPE"'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"PYTHON3"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;With this I can get every row to read 2in HDPE but everytime I try to insert " instead of in I get an error. Could you guys help me please!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;-Jim Noble&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:41:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573748#M44959</guid>
      <dc:creator>JimNoble</dc:creator>
      <dc:date>2021-12-12T00:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573749#M44960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy.CalculateField_management("Underground.dbf", "Conduit",
                                '"2\" HDPE"', "PYTHON3")‍‍&lt;SPAN class="line-numbers-rows"&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;You need a &lt;SPAN style="text-decoration: line-through;"&gt;forward&lt;/SPAN&gt; back slash (\) before the parentheses ("). Otherwise, the Python interpreter will think you are trying to close the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:41:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573749#M44960</guid>
      <dc:creator>GeoJosh</dc:creator>
      <dc:date>2021-12-12T00:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573750#M44961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forward slash?&amp;nbsp; I think "\" is commonly called backslash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even with escaping the double quotes, the string still needs to be single quoted and not double quoted.&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"'2\" HDPE'"&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 21:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573750#M44961</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-01-24T21:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573751#M44962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just got back from an ESRI user seminar: at pro 2.5&amp;nbsp;there finally is Find and Replace functionality!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I shy away from any special characters in database field values; notice how you need to escape them to get them in there. 'nuff said.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 21:16:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573751#M44962</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-01-24T21:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573752#M44963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not quite the same... but "unicode" is quite a large world to fully explore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;dq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;"\u201D"&lt;/SPAN&gt;

f&lt;SPAN class="string token"&gt;"quoting{dq}"&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'quoting”'&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;"quoting{}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dq&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;'quoting”'&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;/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 00:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573752#M44963</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T00:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573753#M44964</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;s &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'12in pipe'&lt;/SPAN&gt;
s &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; s&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'in'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'\"'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;s&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;" pipe&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>Sun, 12 Dec 2021 00:42:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573753#M44964</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T00:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573754#M44965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua, your fix worked perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 02:32:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573754#M44965</guid>
      <dc:creator>JimNoble</dc:creator>
      <dc:date>2020-01-25T02:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573755#M44966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe, while your fix didn't pop any errors, it didn't actually fix the problem. Maybe I was using it wrong. This is what I put in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;#Calculate field Conduit feature class Underground
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;arcpy.CalculateField_management(&lt;SPAN style="color: #6a8759;"&gt;"Underground.dbf"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Conduit"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'"2in HDPE"'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"PYTHON3"&lt;/SPAN&gt;)

&lt;SPAN style="color: #808080;"&gt;#Set in name replace with quotation
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;s = &lt;SPAN style="color: #6a8759;"&gt;'2in HDPE'
&lt;/SPAN&gt;s = s.replace(&lt;SPAN style="color: #6a8759;"&gt;'in'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:42:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573755#M44966</guid>
      <dc:creator>JimNoble</dc:creator>
      <dc:date>2021-12-12T00:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573756#M44967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jim, using Joe's code didn't change anything because you ran it after Calculate Field.&amp;nbsp; The way the code is written now, you are using Calculate Field to update a table and then changing a string within Python but that change is never making it back into a data set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 14:00:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573756#M44967</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-01-25T14:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573757#M44968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see. Thanks for the explanation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 14:16:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573757#M44968</guid>
      <dc:creator>JimNoble</dc:creator>
      <dc:date>2020-01-25T14:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573758#M44969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I offered that just as another example. If you plug it into a field calculator replacing s with !YourFieldName! It ought to work. Python offers many ways to skin a cat...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 15:25:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573758#M44969</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-01-25T15:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using " instead of inches in a field</title>
      <link>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573759#M44970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joe!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 15:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-quot-instead-of-inches-in-a-field/m-p/573759#M44970</guid>
      <dc:creator>JimNoble</dc:creator>
      <dc:date>2020-01-25T15:45:41Z</dc:date>
    </item>
  </channel>
</rss>

