excel file converted to ASCII

Sean_biology

New Member
Joined
Jan 9, 2009
Messages
10
Hi there,

I am tasked with compiling data fin excel Excel and saving as an ASCII file that is readable by SAS statistics.

how do I convert an excel sheet to an ASCII?

thanks much

Sean
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You can use File > Save As and select Text (*.txt) as the file type. Or heres an example using a macro (the .txt file must exist before running it):

Code:
Sub MyOutput()
Dim iMyFreeFile As Integer, LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
iMyFreeFile = FreeFile
Open "C:\testfile.txt" For Output As #iMyFreeFile
For i = 1 To LR
    Write #iMyFreeFile, Range("A" & i).Value, Range("B" & i).Value, Range("C" & i).Value, Range("D" & i).Value, Range("E" & i).Value
Next i
Close #iMyFreeFile
End Sub
 
Upvote 0
Sean, Is this PC SAS? Or SAS on a mainframe?
For PC SAS, it can read in XLS files very easily.
If it's a main frame, try saving the worksheet as a .CSV file, then SAS can read it using an infile statement with delimiter = ','.
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top