<?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: Reading a text file with repeating structure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698350#M213568</link>
    <description>&lt;P&gt;Multiple INPUT statements! That never occurred to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KurtBremser, your solution worked after one minor modification (adding firstobs=2 to the infile statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a million!&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 10:50:02 GMT</pubDate>
    <dc:creator>Norman21</dc:creator>
    <dc:date>2020-11-12T10:50:02Z</dc:date>
    <item>
      <title>Reading a text file with repeating structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698339#M213564</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a text file with a repeating structure, and am having difficulty importing it using either infile or proc import. Each line ends with a CR LF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I have:&lt;/P&gt;
&lt;P&gt;first line (to be skipped)&lt;/P&gt;
&lt;P&gt;&amp;lt;blank&amp;gt;&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;10:02:03&lt;/P&gt;
&lt;P&gt;some text, that might contain commas or semicolons&lt;/P&gt;
&lt;P&gt;&amp;lt;blank&amp;gt;&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;10:02:04&lt;/P&gt;
&lt;P&gt;some more text&lt;/P&gt;
&lt;P&gt;&amp;lt;blank&amp;gt;&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;10:02:07&lt;/P&gt;
&lt;P&gt;yet more text&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I want:&lt;/P&gt;
&lt;P&gt;Var1&amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var3&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10:02:03&amp;nbsp; &amp;nbsp;some text, that might contain commas or semicolons&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10:02:04&amp;nbsp; &amp;nbsp;some more text&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10:02:07&amp;nbsp; &amp;nbsp;yet more text&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should be simple but it has me stumped! Can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 09:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698339#M213564</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2020-11-12T09:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a text file with repeating structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698342#M213566</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile "yourfile" termstr=CRLF truncover;
input; /* skips blank line */
input var1; /* numeric */
input var2 time8.; /* time */
format var2 time8.;
input var3 $100.; /* text, adapt length to maximum expected */
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will work as long as the 4-line sequence is reliably kept; if the sequence might change, further measures are necessary.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 10:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698342#M213566</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T10:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a text file with repeating structure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698350#M213568</link>
      <description>&lt;P&gt;Multiple INPUT statements! That never occurred to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KurtBremser, your solution worked after one minor modification (adding firstobs=2 to the infile statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a million!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 10:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-text-file-with-repeating-structure/m-p/698350#M213568</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2020-11-12T10:50:02Z</dc:date>
    </item>
  </channel>
</rss>

