<?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 Only read numeric values from a file. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12493#M1680</link>
    <description>Hello:&lt;BR /&gt;
&lt;BR /&gt;
I have a data file like the following stored as a .csv file. I would like to only read the numbers out of it. Right now I am using the following code, it reads in the data file, and I would like to delete every other row (eg,row no. 1, 3, 5, 7, ..), or let's say the rows starting with letters, and only output the numbers. How should I do this? &lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance  &lt;BR /&gt;
&lt;BR /&gt;
  &lt;BR /&gt;
&lt;BR /&gt;
filename datain&lt;BR /&gt;
'...matrix.csv' LRECL=500;&lt;BR /&gt;
data matrix;&lt;BR /&gt;
infile datain DELIMITER=',';&lt;BR /&gt;
input  A $ B $ C $ D $ E $ F $;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
TH12,|,TH,5,TH12,|,TH&lt;BR /&gt;
-7.64E-03,6.06E-01,9.98E-03,2.11E-02,3.96E-01,2.08E+00,1.38E-01&lt;BR /&gt;
&lt;BR /&gt;
TH15,|,TH,2,TH15,|,TH&lt;BR /&gt;
4.12E-04,-1.93E-02,-1.74E-03,-1.14E-02,6.39E-01,9.71E-03,2.08E-02&lt;BR /&gt;
&lt;BR /&gt;
TH15,|,TH10,TH15,|,TH12,TH15&lt;BR /&gt;
1.75E-01,9.52E-01,9.07E-01,2.17E-03,5.40E-06,-1.05E-04,1.37E-04&lt;BR /&gt;
&lt;BR /&gt;
OM1213,|,OM0506,OM1213,|,OM0606,OM1213&lt;BR /&gt;
2.91E-07,-1.48E-05,-3.88E-07,-3.53E-08,-1.07E-07,8.66E-08,-8.50E-08</description>
    <pubDate>Thu, 17 Feb 2011 23:05:55 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-02-17T23:05:55Z</dc:date>
    <item>
      <title>Only read numeric values from a file.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12493#M1680</link>
      <description>Hello:&lt;BR /&gt;
&lt;BR /&gt;
I have a data file like the following stored as a .csv file. I would like to only read the numbers out of it. Right now I am using the following code, it reads in the data file, and I would like to delete every other row (eg,row no. 1, 3, 5, 7, ..), or let's say the rows starting with letters, and only output the numbers. How should I do this? &lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance  &lt;BR /&gt;
&lt;BR /&gt;
  &lt;BR /&gt;
&lt;BR /&gt;
filename datain&lt;BR /&gt;
'...matrix.csv' LRECL=500;&lt;BR /&gt;
data matrix;&lt;BR /&gt;
infile datain DELIMITER=',';&lt;BR /&gt;
input  A $ B $ C $ D $ E $ F $;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
TH12,|,TH,5,TH12,|,TH&lt;BR /&gt;
-7.64E-03,6.06E-01,9.98E-03,2.11E-02,3.96E-01,2.08E+00,1.38E-01&lt;BR /&gt;
&lt;BR /&gt;
TH15,|,TH,2,TH15,|,TH&lt;BR /&gt;
4.12E-04,-1.93E-02,-1.74E-03,-1.14E-02,6.39E-01,9.71E-03,2.08E-02&lt;BR /&gt;
&lt;BR /&gt;
TH15,|,TH10,TH15,|,TH12,TH15&lt;BR /&gt;
1.75E-01,9.52E-01,9.07E-01,2.17E-03,5.40E-06,-1.05E-04,1.37E-04&lt;BR /&gt;
&lt;BR /&gt;
OM1213,|,OM0506,OM1213,|,OM0606,OM1213&lt;BR /&gt;
2.91E-07,-1.48E-05,-3.88E-07,-3.53E-08,-1.07E-07,8.66E-08,-8.50E-08</description>
      <pubDate>Thu, 17 Feb 2011 23:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12493#M1680</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-17T23:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Only read numeric values from a file.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12494#M1681</link>
      <description>Use the / pointer control.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data matrix;&lt;BR /&gt;
   infile cards dsd;&lt;BR /&gt;
   input / v1-v7;&lt;BR /&gt;
   cards;&lt;BR /&gt;
TH12,|,TH,5,TH12,|,TH&lt;BR /&gt;
-7.64E-03,6.06E-01,9.98E-03,2.11E-02,3.96E-01,2.08E+00,1.38E-01&lt;BR /&gt;
TH15,|,TH,2,TH15,|,TH&lt;BR /&gt;
4.12E-04,-1.93E-02,-1.74E-03,-1.14E-02,6.39E-01,9.71E-03,2.08E-02&lt;BR /&gt;
TH15,|,TH10,TH15,|,TH12,TH15&lt;BR /&gt;
1.75E-01,9.52E-01,9.07E-01,2.17E-03,5.40E-06,-1.05E-04,1.37E-04&lt;BR /&gt;
OM1213,|,OM0506,OM1213,|,OM0606,OM1213&lt;BR /&gt;
2.91E-07,-1.48E-05,-3.88E-07,-3.53E-08,-1.07E-07,8.66E-08,-8.50E-08 &lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 17 Feb 2011 23:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12494#M1681</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-02-17T23:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Only read numeric values from a file.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12495#M1682</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
you can check if the first character is a digit. the output statement in the syntax is necessary since the return statement contains an implicit OUTPUT statement:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data x;&lt;BR /&gt;
infile datalines dlm=',' truncover;&lt;BR /&gt;
input @;&lt;BR /&gt;
if anyalpha(substr(_infile_,1,1)) then return;&lt;BR /&gt;
input A $ B $ C $ D $ E $ F $;&lt;BR /&gt;
output;&lt;BR /&gt;
datalines;&lt;BR /&gt;
TH12,|,TH,5,TH12,|,TH&lt;BR /&gt;
-7.64E-03,6.06E-01,9.98E-03,2.11E-02,3.96E-01,2.08E+00,1.38E-01&lt;BR /&gt;
TH15,|,TH,2,TH15,|,TH&lt;BR /&gt;
4.12E-04,-1.93E-02,-1.74E-03,-1.14E-02,6.39E-01,9.71E-03,2.08E-02&lt;BR /&gt;
TH15,|,TH10,TH15,|,TH12,TH15&lt;BR /&gt;
1.75E-01,9.52E-01,9.07E-01,2.17E-03,5.40E-06,-1.05E-04,1.37E-04&lt;BR /&gt;
OM1213,|,OM0506,OM1213,|,OM0606,OM1213&lt;BR /&gt;
2.91E-07,-1.48E-05,-3.88E-07,-3.53E-08,-1.07E-07,8.66E-08,-8.50E-08 &lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Marius</description>
      <pubDate>Fri, 18 Feb 2011 09:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Only-read-numeric-values-from-a-file/m-p/12495#M1682</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-18T09:32:00Z</dc:date>
    </item>
  </channel>
</rss>

