Reading Tab-Delimited Data with SPSS 
====================================

In SPSS for Windows, Tab-Delimited raw data files can be 
read using the GET TRANSLATE command or the File>Open
menu choice.  In the UNIX versions of SPSS (Version 6.1), 
however, this command is not available.

To read a tab-delimited raw data file using SPSS under UNIX,
it is necessary first to convert your tabs into spaces 
using emacs.  This procedure is relatively easy.  This
method (i.e., converting the TABs to spaces) will work anywhere
as long as the only TABs in the data are used for separating
data values, and there are no 'embedded blanks' in the data
values themselves.

Tab-Delimited data are values that are separated by the TAB
character, rather than with commas, real spaces, or other
characters.  Typically, such data are stored when users type
in a data value, hit the TAB key, another data value, TAB,
data value, TAB, and so forth.  Tab-Delimited data also can be
output from spreadsheet programs.  Tab-delimited data might look
like:

	98	43	25	43	15
	25	63	41	25	43
	29	52	49	41	66

Note that Space-Delimited data also can look like the above.
The difference is that the spacing between the values is
done with a single TAB character (which is unseen), not 
several 'real blanks'.  

For comparison, Comma-Delimited data might look like the following:

       98,43,25,43,15
       25,63,41,25,43
       29,52,49,41,66

and Space-Delimited data (using one space between values) might
look like:

       98 43 25 43 15
       25 63 41 25 43
       29 52 49 41 66

Since SPSS can read Space-Delimited data with the use of the
FREE keyword in the DATA LIST command, it is suggested that you
prepare your raw data before processing with SPSS by changing
the TAB characters to spaces using emacs.  Here is the method:

  1. UNIX Prompt>   cp  tab.data  converted.data  (this step is optional)

  2. UNIX Prompt>  emacs  converted.data

  3. in emacs:

      a. ESC-SHIFT-5 (i.e., ESC-%) gives you "Query replace:"
      b. at "Query replace:" prompt, type CTRL-Q, TAB
            (i.e., CTRL-Q followed by the TAB key; nothing but a space
            will appear on the screen where the TAB key is typed; don't
            worry.)  System will respond with "With:"
      c. at "With:" prompt, type a space (space bar), and the cursor 
            will move to the first TAB character in your data and wait.
      d. to replace TABs one at a time, type 'y' (for 'yes') at each
            one.  To replace them all at once, type SHIFT-1 (i.e., the
            '!' or exclamation point) and all the TABs will be replaced
            with spaces.

After you save the converted data (CTRL-X, CTRL-S in emacs), your 
data then will be space-delimited, and you can read the file with
a DATA LIST command like the following:

  DATA  LIST  FREE  FILE='converted.data' / ID  HEIGHT  WEIGHT AGE  IQ.