<?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: Split cells based on soft enter in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770520#M81050</link>
    <description>&lt;P&gt;Maybe I wasn't very clear on my target.&amp;nbsp;The initial input file has the soft enter as delimiter and I want to break those cells based on the soft enter to new lines. The target goal is to have a table organized as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;input Store $ Date $ Result $40.;&lt;BR /&gt;datalines;&lt;BR /&gt;B2120661 9/8/2021 Sale/Dishwasher-1: $20: Tom: 10.08&lt;BR /&gt;B2120661 9/8/2021 Sale/Dishwasher-2: $21: Anthony: 13.19&lt;BR /&gt;B2120661 9/8/2021 Return/Dishwasher-1: $20: Anthony: 11.380&lt;BR /&gt;B2120661 9/8/2021 Sale/Blender12: $5: Mary: 3.3&lt;BR /&gt;B2120661 9/8/2021 Sale/Blender-2: $5.1: Tom: 2.11&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Sep 2021 15:48:37 GMT</pubDate>
    <dc:creator>Giovani</dc:creator>
    <dc:date>2021-09-26T15:48:37Z</dc:date>
    <item>
      <title>Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770480#M81046</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have a table with content that needs further exploration, placed all in one cell and separated by soft enter. Each entry is accompanied by information like day, ID etc. Any help in how I can break the cell into lines at the soft enter character?&lt;BR /&gt;The top part of the image represents what is in the excel file. The down part is just a paste-in word document to visualize the breakpoints. Excell attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AHMES-7.PNG" style="width: 693px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64075iC142457FBD9A8443/image-size/large?v=v2&amp;amp;px=999" role="button" title="AHMES-7.PNG" alt="AHMES-7.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 12:09:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770480#M81046</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2021-09-26T12:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770486#M81047</link>
      <description>&lt;P&gt;You want this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.heart;
 have=catx('(*ESC*)n',status,sex,Weight_Status,Smoking_Status);
 keep have;
run;


ods excel file='c:\temp\temp.xlsx';
proc print data=have(obs=100);run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1632659201763.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64076i8464172F816D04BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1632659201763.png" alt="Ksharp_0-1632659201763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 12:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770486#M81047</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-26T12:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770492#M81048</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;;&lt;BR /&gt;Not really, I want the column "have" to be breeake into different lines. Cell 1 would generate 4 lines:&lt;BR /&gt;1 Dead&lt;BR /&gt;1 Female&lt;BR /&gt;1 Overweight&lt;BR /&gt;1 Non-smoker</description>
      <pubDate>Sun, 26 Sep 2021 12:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770492#M81048</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2021-09-26T12:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770493#M81049</link>
      <description>&lt;P&gt;OK. You want soft enter as delimiter ?&lt;/P&gt;
&lt;P&gt;Try this one :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have2;
 set have;
 do i=1 to countw(have,'0D0A'x);
   have2=scan(have,i,'0D0A'x);output;
 end;
run;


ods excel file='c:\temp\temp.xlsx';
proc print data=have2(obs=100);run;
ods excel close;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Sep 2021 12:56:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770493#M81049</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-09-26T12:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770520#M81050</link>
      <description>&lt;P&gt;Maybe I wasn't very clear on my target.&amp;nbsp;The initial input file has the soft enter as delimiter and I want to break those cells based on the soft enter to new lines. The target goal is to have a table organized as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;input Store $ Date $ Result $40.;&lt;BR /&gt;datalines;&lt;BR /&gt;B2120661 9/8/2021 Sale/Dishwasher-1: $20: Tom: 10.08&lt;BR /&gt;B2120661 9/8/2021 Sale/Dishwasher-2: $21: Anthony: 13.19&lt;BR /&gt;B2120661 9/8/2021 Return/Dishwasher-1: $20: Anthony: 11.380&lt;BR /&gt;B2120661 9/8/2021 Sale/Blender12: $5: Mary: 3.3&lt;BR /&gt;B2120661 9/8/2021 Sale/Blender-2: $5.1: Tom: 2.11&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 15:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770520#M81050</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2021-09-26T15:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770522#M81051</link>
      <description>&lt;P&gt;Just use the SCAN() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have ;
  do line=1 by 1 until(line &amp;gt;= countw(results,'0D0A'x));
    result_line = scan(results,line,'0D0A'x);
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Sep 2021 16:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770522#M81051</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-26T16:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770526#M81052</link>
      <description>&lt;P&gt;as you present it that way, I assume you have imported the "initial input file" and it has those multiple "lines" in the third column/cell and it is now in a sas dataset called "imported_data" which has that third column in sas variable "col3";&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data better_data ;&lt;/P&gt;
&lt;P&gt;set&amp;nbsp; imported_data ;&lt;/P&gt;
&lt;P&gt;*drop col3&amp;nbsp; ;&amp;nbsp; &amp;nbsp;****once confident, drop col3 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;length&amp;nbsp; result $40 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;result = scan( col3, 1, "0a0d"x ); * allows 0Ax or 0Dx as soft delimiter ;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;do col3_row= 1 by 1 while( result ne ' ' ) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;output ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;result = scan( col3, col3_row+1, "0a0d"x );&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;end ;&lt;/P&gt;
&lt;P&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 16:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770526#M81052</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2021-09-26T16:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Split cells based on soft enter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770534#M81053</link>
      <description>&lt;P&gt;This solution also works!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 19:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Split-cells-based-on-soft-enter/m-p/770534#M81053</guid>
      <dc:creator>Giovani</dc:creator>
      <dc:date>2021-09-26T19:03:16Z</dc:date>
    </item>
  </channel>
</rss>

