Skip to Main Content

Getting Started with SPSS

Importing Data into SPSS

In addition to data saved in SPSS format (.sav), SPSS is able to read various types of files including Excel, CSV, SAS and Stata. In this section, we will demonstrate how to import data from two common file formats: Excel file and CSV file.

Importing an Excel file

The sample Excel file “demo.xlsx” used in this guide is installed with SPSS, which can be found in the Samples subdirectory of the installation directory. The image below shows what the sample dataset looks like in Excel.

  1. From the menu, choose File > Import Data > Excel, the dialog box “Open Data” will pop up. Locate and select the Excel file, then click Open. You can also drag and drop an existing file directly into an open SPSS window.

  1. The “Read Excel File” dialog box will appear. Select appropriate settings.

 

  • Worksheet: Choose the sheet you would like to import if your Excel file contains multiple worksheets. 
  • Make sure Read variable names from first row of data is selected.
  • Remove leading spaces from string values and Remove trailing spaces from string values can remove blank spaces at the beginning and end of the string values.
  • Percentage of values that determine data type: SPSS can assign data type to each variable based on the proportion of values in a particular column. In our example, the variable “Marital Status” contains both numerical values and string values “no answer”, by selecting Percentage of values that determine data type, the variable is read as a numerical data type and the “no answer” values are removed.
  1. Click OK to import the data.

Importing a CSV file

  1. From the menu, choose File > Import Data > CSV, the dialog box “Open Data” will pop up. Locate and select the CSV file, then click Open. You can also drag and drop an existing file directly into an open SPSS window.
  2. The “Read CSV File” dialog box will appear. Select appropriate settings.

 

  • Make sure Read variable names from first row of data is selected
  • Delimiter between values: The delimiter is the character that separates each data value. Users can choose from “comma”, “semicolon” and “tab” in the dialog box (“comma” is selected in most cases). If the delimiter is other characters or a blank space, use Advanced Option (Text Wizard) to import the data.
  • Text Qualifier: The text qualifier is the character used to enclose values that contain the delimiter character. Select “Double Quote” as text qualifier.
  • You can go to Advanced Option (Text Wizard) to access more options to customize the data import.
  1. Click OK to import the data.

McGill LibraryQuestions? Ask us!
Privacy notice