ASCII Data Files to SPSS Data Files

You will sometimes receive data from an external source as ASCII data, or you might create your data files in ASCII with Notepad (or some other word processor that can output in ASCII).  Examine the following SPSS data file:

ITEM ORDER  GRAM  RT-MS
1     80       0      1152
2     34       0      1778
3     57       0      1921
4     72       0      1561
5     62       0      1420
6     8        0      2336

The following instructions show how to create this SPSS data file from an ASCII data file.

Creating ASCII Data Files
To create ASCII files, click the Notepad icon in Windows and type the following data:

1 80 0 1152
2 34 0 1778
3 57 0 1921
4 72 0 1561
5 62 0 1420
6 8 0 2336

Make sure a single space separates all individual numbers. Next, save the data on the a: drive.

Converting ASCII Data Files
To convert the ASCII data file to an SPSS data file, use SPSS software to read the ASCII file.  After SPSS reads the file, save the converted file in SPSS format.  Because different versions of SPSS read and save ASCII files differently, follow the instructions that apply.

Version 8 of SPSS

  1. Select "Read ASCII Data" from the "File" menu
  2. Select the proper disk (i.e., a: drive)
  3. Select "freefield" data
  4. Select "all files" from "list of file types"
  5. Double-click on the filename of your ASCII data file
  6. When the window appears, type the name of the first variable in the data file (i.e., "item")
  7. Click the "Add" button
  8. Type the name of the second variable (i.e., order) and click "Add"
  9. Repeat until you name all of the variables in the data file
  10. Click "Ok"
  11. Select "Save" from the "File" menu 

Version 9 of SPSS

  1. Select "Read Text Data" from the "File" menu
  2. Select the drive and file to open (from the a: drive)
  3. "Does your file match a predefined file format?" Click "No" and then "Next"
  4. "How are your variables arranged?" Click "Delimited"
  5. "Are variable names included at the top of your file?" Click "No" and then "Next"
  6. "How are your cases represented?" Click "Each line represents a case"
  7. "How many cases do you want to import?" Click "All of the cases" and then "Next"
  8. "Which delimiters appear between the variables?" Click "Space" and then "Next"
  9. "Specifications for variables selected in the data preview" Click "V1" (variable one) at the bottom of the window
  10. Type the first variable name (i.e., "item") 
  11. Click "Numeric" if the variable is a number. Click "String" if the variable is a word
  12. Repeat steps (9) through (11) for the rest of the variables (V2, V3, etc.) in the data file
  13. Click "Next" when finished
  14. "Would you like to save this file format for future use?" Click "No"
  15. "Would you like to paste the syntax?" Click "No" and then "Finish"