<?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 READING text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677960#M204584</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;I've data as below and embedded with multiple spaces between time and number columns data. Please let me know how to read this inconsistent "ID" column data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SNO, DATE, TIME,ID, NUMBER, COST, DISCOUNT&lt;BR /&gt;0 26/08/2010 16:33:36 LOC MH 5533442211 42 0.90&lt;BR /&gt;1 26/08/2010 16:34:29 LOC MH 5533442212 14 0.90&lt;BR /&gt;2 26/08/2010 16:35:20 9422 5533442213 74 1.80&lt;BR /&gt;3 28/08/2010 12:13:38 CHI - MH 5533442214 41 0.90&lt;BR /&gt;4 28/08/2010 12:59:20 9823 5533442215 15 0.90&lt;/P&gt;</description>
    <pubDate>Thu, 20 Aug 2020 06:27:43 GMT</pubDate>
    <dc:creator>LOVE_SAA</dc:creator>
    <dc:date>2020-08-20T06:27:43Z</dc:date>
    <item>
      <title>READING text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677960#M204584</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;I've data as below and embedded with multiple spaces between time and number columns data. Please let me know how to read this inconsistent "ID" column data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SNO, DATE, TIME,ID, NUMBER, COST, DISCOUNT&lt;BR /&gt;0 26/08/2010 16:33:36 LOC MH 5533442211 42 0.90&lt;BR /&gt;1 26/08/2010 16:34:29 LOC MH 5533442212 14 0.90&lt;BR /&gt;2 26/08/2010 16:35:20 9422 5533442213 74 1.80&lt;BR /&gt;3 28/08/2010 12:13:38 CHI - MH 5533442214 41 0.90&lt;BR /&gt;4 28/08/2010 12:59:20 9823 5533442215 15 0.90&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 06:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677960#M204584</guid>
      <dc:creator>LOVE_SAA</dc:creator>
      <dc:date>2020-08-20T06:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: READING text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677967#M204586</link>
      <description>&lt;P&gt;Is that really what you have in the file?&lt;/P&gt;
&lt;P&gt;The header is comma-separated, but the data is not.&lt;/P&gt;
&lt;P&gt;I suggest that you view the file with a pure text editor (Windows Editor or Notepad++) and copy/paste the first few lines into a window opened with the indicated button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg"&gt;&lt;img src="https://communities.sas.com/skins/images/E0BB18E7DAA53C21BC28740CEA0E38DA/responsive_peak/images/image_not_found.png" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will give us a clearer picture of what you are dealing with.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 06:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677967#M204586</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-20T06:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: READING text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677969#M204587</link>
      <description>&lt;P&gt;You could play with the `_infile_` and scan() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  input;
  length SNO $ 8 DATE TIME 8 ID $ 32 NUMBER COST DISCOUNT 8 _time _number $ 20;
  format DATE yymmdd10. TIME time9.;

  SNO = scan (_infile_, 1, " ");
  DATE = input( scan (_infile_, 2, " "), ddmmyy10.);
  _TIME = scan (_infile_, 3, " ");
  TIME = input(_TIME, time9.);
  _NUMBER = scan (_infile_, -3, " "); 
  NUMBER = input(_NUMBER, best32.);
  COST = input( scan (_infile_, -2, " "), best32.); 
  DISCOUNT = input( scan (_infile_, -1, " "), best32.);

  _n = find(_infile_, _TIME, "T") + 8;
  _m = find(_infile_, _NUMBER, "T");
  ID = substr(_infile_, _n, _m - _n);

  drop _:;
cards;
0 26/08/2010 16:33:36 LOC MH 5533442211 42 0.90
1 26/08/2010 16:34:29 LOC MH 5533442212 14 0.90
2 26/08/2010 16:35:20 9422 5533442213 74 1.80
3 28/08/2010 12:13:38 CHI - MH 5533442214 41 0.90
4 28/08/2010 12:59:20 9823 5533442215 15 0.90
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;all the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 07:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/READING-text-file/m-p/677969#M204587</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-08-20T07:04:39Z</dc:date>
    </item>
  </channel>
</rss>

