Sort a file by one or more variables

The Sort option of Tools|Combine, Sort and Merge SPSS Files allows you to sort an SPSS (*.sav) or comma delimited (*.csv) file by one or more variables and save the sorted output to an SPSS (*.sav) data file.

 

Browse

Choose Browse to a data file for sorting. Use the Take variable names from first line of data file (*.csv data files only) option to use the variable names from the first line of the data file for comma delimited (*.csv) files. You can choose an SPSS (*.sav) or comma delimited (*.csv) data file.

 

 

Variable list

The Variable list box displays the variables from the selected data file.

 

Find a variable

Allows you to enter search criteria to locate a specific variable. This is especially useful when there are many variables in your data files and you only want to find a specific variable or group of variables.

 

Next

Finds the next occurrence of the search value specified in Find a variable.

 

Add

Choose Add to select a variable to be used as a Sort variable. The variable is added to the Sort list box with a default sort order of Ascending. To change the sort order for a selected variable, use the Ascending or Descending options below the Sort list box.

 

Remove

Choose Remove to remove a variable from the Sort list box. Multiple variables (contiguous and non-contiguous) can be selected and removed at one time.

 

Move Up/Move Down

Use the Move Up and Move Down options to rearrange the order of the variables in the Sort list box. Multiple variables (contiguous and non-contiguous) can be selected and moved at one time using these options.

 

Sort

Choose Sort to create the output file and display the output record count. The output file can only be saved as an SPSS (*.sav) data file.

 

Close

Selecting the Close button will close the Sort dialog box.

 

Related topics:

Join two files together

Sort a file by one or more variables