<?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: Find and delete Carriage returns in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1118739#M48040</link>
    <description>&lt;P&gt;It isn't pretty, but it is simple to implement.&amp;nbsp; You can use a chained Python string replace call:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; s = "NRSP21_Rose Court_A\r\n_1_211012_162927447_16"
&amp;gt;&amp;gt;&amp;gt; print(s)
NRSP21_Rose Court_A
_1_211012_162927447_16
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; s_new = s.replace("\r", "").replace("\n", "")
&amp;gt;&amp;gt;&amp;gt; print(s_new)
NRSP21_Rose Court_A_1_211012_162927447_16
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 19 Nov 2021 16:45:32 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2021-11-19T16:45:32Z</dc:date>
    <item>
      <title>Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1115988#M47747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working with a Feature Service created from a Survey123 form.&lt;/P&gt;&lt;P&gt;Some of the users have inadvertently added carriage returns in their answers.&lt;/P&gt;&lt;P&gt;Is there a way to find the carriage returns and delete them, either using Find and Replace or a Field Calculator expression?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 11:29:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1115988#M47747</guid>
      <dc:creator>IFI</dc:creator>
      <dc:date>2021-11-11T11:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1116038#M47749</link>
      <description>&lt;P&gt;There's a related thread &lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/remove-all-empty-spaces-at-the-end-of-the-text/td-p/792158" target="_self"&gt;here&lt;/A&gt; that adds a constraint to prevent survey responses from having trailing "whitespace" or "carriage returns" that seems to also prevent this from occurring in the middle of the response as well.&amp;nbsp; To remove extra spaces on existing attribute values using Arcade, there's a related thread &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/remove-extra-spaces-from-string-using-arcade/td-p/248703" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp; Good luck!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:40:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1116038#M47749</guid>
      <dc:creator>Robert_LeClair</dc:creator>
      <dc:date>2021-11-11T15:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1118631#M48022</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;Thanks for that! I still need to figure out a way of removing the carriage returns in bulk!&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 13:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1118631#M48022</guid>
      <dc:creator>IFI</dc:creator>
      <dc:date>2021-11-19T13:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1118739#M48040</link>
      <description>&lt;P&gt;It isn't pretty, but it is simple to implement.&amp;nbsp; You can use a chained Python string replace call:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;&amp;gt;&amp;gt;&amp;gt; s = "NRSP21_Rose Court_A\r\n_1_211012_162927447_16"
&amp;gt;&amp;gt;&amp;gt; print(s)
NRSP21_Rose Court_A
_1_211012_162927447_16
&amp;gt;&amp;gt;&amp;gt;
&amp;gt;&amp;gt;&amp;gt; s_new = s.replace("\r", "").replace("\n", "")
&amp;gt;&amp;gt;&amp;gt; print(s_new)
NRSP21_Rose Court_A_1_211012_162927447_16
&amp;gt;&amp;gt;&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Nov 2021 16:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1118739#M48040</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-11-19T16:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1119124#M48106</link>
      <description>&lt;P&gt;Hi Joshua,&lt;/P&gt;&lt;P&gt;Thanks for the reply. I guess I could implement that in a Field Calculator Expression?&lt;/P&gt;&lt;P&gt;Also, this replaces the carriage return (and space if I'm reading it correctly) for that particular row only, is that right? I would need a more complicated expression to find and replace them in a number of rows?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 08:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1119124#M48106</guid>
      <dc:creator>IFI</dc:creator>
      <dc:date>2021-11-22T08:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1170158#M54704</link>
      <description>&lt;P&gt;Not sure if OP has already found a solution for multiple rows, but I had the same issue. Difference is I am dealing with a feature class - not hosted feature layer - with over 311,000 rows. Below is what I did in Pro to remove the carriage return and new line in one field of a feature class.&lt;/P&gt;&lt;P&gt;Note that I had to deal with thousands of nulls, which my first if statement identifies them as either None, no space, and single space, and then does nothing to it.&lt;/P&gt;&lt;P&gt;Then, instead of replacing "\r" and "\n", I have to use its respective chr() method, following&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;'s replace function (thanks Joshua!)&lt;/P&gt;&lt;P&gt;Run time was about 2 minutes.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.UpdateCursor("layerName","fieldName") as cursor:
        for row in cursor:
            if row[0] in (None,""," ","Anything-Else-To-Avoid"):
            else:
                row[0] = row[0].replace(chr(13),"").replace(chr(10),"")
                #if you wanted visual confirm use print(row[0])
                cursor.updateRow(row)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 15:06:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1170158#M54704</guid>
      <dc:creator>Aldo_</dc:creator>
      <dc:date>2022-05-03T15:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find and delete Carriage returns</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1277958#M67898</link>
      <description>&lt;P&gt;Aldo:&lt;/P&gt;&lt;P&gt;Did you run this code in the field calculator or a standalone python script?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 19:09:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/find-and-delete-carriage-returns/m-p/1277958#M67898</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2023-04-12T19:09:41Z</dc:date>
    </item>
  </channel>
</rss>

