<?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: How to saving file xlsx to csv filetype in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719556#M222810</link>
    <description>&lt;P&gt;LibreOffice can do such conversions from the commandline.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2021 09:04:55 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-02-16T09:04:55Z</dc:date>
    <item>
      <title>How to saving file xlsx to csv filetype</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719290#M222704</link>
      <description>&lt;P&gt;Hi SAS Users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Recently I have been stucked with data import. As suggested by some experts in this group, especially&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, I am thinking of changing the data type from xlsx to csv to make the data plainer and let it be easier to be dealt with later on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, regarding saving excel file (xlsx datatype) to csv file, whether we only use the saving function from excel like the picture below&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="My97_0-1613379384332.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54727i5399F0355E2BBB4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="My97_0-1613379384332.png" alt="My97_0-1613379384332.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And is there any notice I need to do when saving from xlsx to CSV type to import to SAS later on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it looks like that when saving from xlsx to csv type, we cannot save the whole workbook but just sheets individually, please correct me if I understand incorrectly, is there any way to save the whole workbook or any alternative way to do so?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="My97_0-1613379804424.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54729iA41880490BD1F7DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="My97_0-1613379804424.png" alt="My97_0-1613379804424.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am really new to CSV, all comments and contributions are highly appreciated, especially letting it be friendly to SAS environment!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 09:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719290#M222704</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-02-15T09:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to saving file xlsx to csv filetype</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719303#M222709</link>
      <description>&lt;P&gt;If there is only one sheet in each file, just click "OK" and everything is fine. Important: Don't open csv-files with excel, use a text editor (like notepad++) instead.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 09:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719303#M222709</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-02-15T09:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to saving file xlsx to csv filetype</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719491#M222768</link>
      <description>&lt;P&gt;Yes, one sheet per CSV file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my opinion, the best way to do this is to run a vbs script fro SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example (taken from &lt;A href="https://excelfox.com/forum/showthread.php/388-export-all-worksheets-to-separate-csv-files" target="_blank"&gt;https://excelfox.com/forum/showthread.php/388-export-all-worksheets-to-separate-csv-files&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Run it like so: wscript xls2cvs.vbs C:\SourceFile.xls C:\DestFile.csv&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV class="bbcode_container"&gt;
&lt;DIV class="bbcode_description"&gt;&amp;nbsp; &amp;nbsp; Code:&lt;/DIV&gt;
&lt;PRE class="bbcode_code"&gt;if WScript.Arguments.Count &amp;lt; 2 Then
    WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
    Wscript.Quit
End If

Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
Dim oSheet

If oBook.Sheets.count = 1 Then 
  'save a single sheet
  oBook.SaveAs WScript.Arguments.Item(1), 6
else
  'save multiple sheets
  i=1
  aname=split(Wscript.Arguments.Item(1),".",-1,1)
  For Each oSheet In oBook.WorkSheets
    fname = aname(0) &amp;amp; "_sheet" &amp;amp; Cstr(i)
    oSheet.SaveAs fname, 6
    i=i+1
  Next   
End If

oBook.Close True
oExcel.Quit
WScript.Quit
set oSheet = Nothing
set oBook = Nothing
set oExcel = Nothing&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 Feb 2021 23:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719491#M222768</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-02-15T23:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to saving file xlsx to csv filetype</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719556#M222810</link>
      <description>&lt;P&gt;LibreOffice can do such conversions from the commandline.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 09:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-saving-file-xlsx-to-csv-filetype/m-p/719556#M222810</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-16T09:04:55Z</dc:date>
    </item>
  </channel>
</rss>

