Importing a Tab Delimited File
Importing a tab-delimited file is a little different than other types of text files.
Let's look at the file named txt_practice_04.txt.
The file is a tab-delimited file. Each value is separated by a tab.
Now, when reading a tab-delimited file, you need to do two things differently:
Filename txt_fl4 '/home/kisumsam/proc_import/txt_practice_04.txt'; proc import datafile=txt_fl4 out = txt_fl4 dbms = tab replace; delimiter = '09'x; run;
The DBMS=TAB option tells SAS the source file is a tab-delimited file.
The '09'x is the hexadecimal representation of a tab. It tells SAS the values are separated by a tab.
The file is again imported properly into SAS.
Use Proc Import to import the txt_practice_05.txt.
The GUESSINGROWS option can also be used when importing text or tab delimited files.
** Remember to change the path in the FILENAME statement **;
filename txt_fl5 '/home/your_user_name/proc_import/txt_practice_05.txt';
proc import datafile=txt_fl5
out = txt_fl5
dbms = tab
delimiter = '09'x;
guessingrows = max;