<?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 Import Excel file with no-use Text info in the first few rows. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395224#M95272</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to import Excel expenditure form. The first 11 row is non-standard with all company information and I dont need it. So I should start from row 12.&lt;/P&gt;
&lt;P&gt;And the last few rows contain requirement which I dont need them either.&lt;/P&gt;
&lt;P&gt;I attached sample file here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My approach to it is to import from row 12, and then delete any row after the Total number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the following code but can get the import done.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data TimeHour ;
infile "C:\Users\Original Files\test.xlsx"
firstobs=12
dlm=','  dsd truncover ;
input Date date9.	Start :$100 End :$100 Hotel :$100 GroundTransit :$100	Airfare	CarRental	Meals	
Phone	Miles	MileageReimbursment	Misc :$100	Description	:$100 CompanyPaid	col1 Total

;run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2017 18:54:40 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2017-09-12T18:54:40Z</dc:date>
    <item>
      <title>Import Excel file with no-use Text info in the first few rows.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395224#M95272</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to import Excel expenditure form. The first 11 row is non-standard with all company information and I dont need it. So I should start from row 12.&lt;/P&gt;
&lt;P&gt;And the last few rows contain requirement which I dont need them either.&lt;/P&gt;
&lt;P&gt;I attached sample file here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My approach to it is to import from row 12, and then delete any row after the Total number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the following code but can get the import done.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help, please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data TimeHour ;
infile "C:\Users\Original Files\test.xlsx"
firstobs=12
dlm=','  dsd truncover ;
input Date date9.	Start :$100 End :$100 Hotel :$100 GroundTransit :$100	Airfare	CarRental	Meals	
Phone	Miles	MileageReimbursment	Misc :$100	Description	:$100 CompanyPaid	col1 Total

;run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 18:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395224#M95272</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-09-12T18:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel file with no-use Text info in the first few rows.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395225#M95273</link>
      <description>&lt;P&gt;You can't use a data step to read an XLSX file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you convert it to CSV or text you can process it as desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can try the RANGE specification in PROC IMPORT. I'd probably specify the RANGE - you only need to know the start cell - and then post process the data to remove the last lines. If you know the full range that's easier.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 18:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395225#M95273</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-12T18:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel file with no-use Text info in the first few rows.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395238#M95275</link>
      <description>&lt;P&gt;So I save the file as CSV.&lt;/P&gt;
&lt;P&gt;But when I run the code, still data not imported properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 19:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395238#M95275</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-09-12T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel file with no-use Text info in the first few rows.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395241#M95276</link>
      <description>&lt;P&gt;Sorry, I fix it.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;HC&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 19:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-file-with-no-use-Text-info-in-the-first-few-rows/m-p/395241#M95276</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2017-09-12T19:21:20Z</dc:date>
    </item>
  </channel>
</rss>

