<?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 How do I remove excessive delimiters? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341108#M272747</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can you assist with the following problem? I am trying to clean a large semi-structured dataset and I am on the cusp of solving this problem. Below is an example of the data that I need to clean by removing excessive delimiters (in this case commas) whilst maintaining at least one delimiter between variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataline:&amp;nbsp;123456,,,,,,,,,,,,Test,,,,,,,,,,,,,,,,Delivery Assistant,,,,,,,,,,,,,,,01/0512016,,,,,,,,,,,,,2016-o5·01,,,,,,,,,,,,,Public Holiday,,,,,,,,,,,,,,,6.00,,,,,,,,,,,,,,,,,,,8:00,,,,,,,38.32,,,,,,,,,,,306.56,,,,,,,,,,,,,,,,,,,,,,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Required output:&amp;nbsp;&lt;SPAN&gt;123456&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Test&lt;/SPAN&gt;&lt;SPAN&gt;,Delivery Assistant,01/0512016,2016-o5·01,Public Holiday,6.00,8:00,38.32,306.56&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried using substr, trim, compress however I have not been able to achieve the required output.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any assistance would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Mar 2017 08:39:41 GMT</pubDate>
    <dc:creator>MattSan</dc:creator>
    <dc:date>2017-03-15T08:39:41Z</dc:date>
    <item>
      <title>How do I remove excessive delimiters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341108#M272747</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please can you assist with the following problem? I am trying to clean a large semi-structured dataset and I am on the cusp of solving this problem. Below is an example of the data that I need to clean by removing excessive delimiters (in this case commas) whilst maintaining at least one delimiter between variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataline:&amp;nbsp;123456,,,,,,,,,,,,Test,,,,,,,,,,,,,,,,Delivery Assistant,,,,,,,,,,,,,,,01/0512016,,,,,,,,,,,,,2016-o5·01,,,,,,,,,,,,,Public Holiday,,,,,,,,,,,,,,,6.00,,,,,,,,,,,,,,,,,,,8:00,,,,,,,38.32,,,,,,,,,,,306.56,,,,,,,,,,,,,,,,,,,,,,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Required output:&amp;nbsp;&lt;SPAN&gt;123456&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Test&lt;/SPAN&gt;&lt;SPAN&gt;,Delivery Assistant,01/0512016,2016-o5·01,Public Holiday,6.00,8:00,38.32,306.56&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried using substr, trim, compress however I have not been able to achieve the required output.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any assistance would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 08:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341108#M272747</guid>
      <dc:creator>MattSan</dc:creator>
      <dc:date>2017-03-15T08:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove excessive delimiters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341112#M272748</link>
      <description>&lt;P&gt;If you do not specify the dsd option in the infile statement, consecutive delimiters are automatically treated as one.&lt;/P&gt;
&lt;P&gt;Take care that no missing values can appear in the input data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile cards dlm=',';
input number text $ position:$20. serial:$10. chardate:$10. Daytext:$20. amount1 time:time8. amount2 amount3;
format time time8.;
cards;
123456,,,,,,,,,,,,Test,,,,,,,,,,,,,,,,Delivery Assistant,,,,,,,,,,,,,,,01/0512016,,,,,,,,,,,,,2016-o5·01,,,,,,,,,,,,,Public Holiday,,,,,,,,,,,,,,,6.00,,,,,,,,,,,,,,,,,,,8:00,,,,,,,38.32,,,,,,,,,,,306.56,,,,,,,,,,,,,,,,,,,,,,
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Mar 2017 08:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341112#M272748</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-15T08:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove excessive delimiters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341113#M272749</link>
      <description>&lt;P&gt;Try the perl regular expressions to substitute the multiple delimiters to single delimiter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
new=prxchange('s/\,+/,/',-1,datal) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Mar 2017 09:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-remove-excessive-delimiters/m-p/341113#M272749</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-03-15T09:03:18Z</dc:date>
    </item>
  </channel>
</rss>

