The DCS grading programs — gselect

Gselect copies its input grades file to the standard output, omitting those student records that were not accepted by the selection criteria.

Usage

gselect [-?] [-9] [selection options] [file]

Details

Gselect selects student records to be retained, using the selection options. One other option is accepted:

-9 Use nine-digit student numbers in the output files, if possible.
 

Only one file argument is accepted. If no file is specified, input comes from the standard input. Output always goes to the standard output, since gselect's reason for being is to provide temporary files for use in pipes and on-line marks lookup. It is not intended for destroying data permanently.

An example

Suppose you have a program to allow students to look up their marks on-line, using gpubreport to give only a single student's marks at a time. Imagine that you want the records of students who have dropped the course not to be displayed. You would then use gpubreport's -d option to eliminate those who have dropped, and -n or -# to select the correct individual's record.

gpubreport -d -nEinstein gradesfile

But it won't work, because the inclusion option on the name or student number overrides the omission option on the drop indicator. Instead, you need to filter your grades file through gselect:

gselect -d gradesfile | gpubreport -nEinstein

Now the records for students who have dropped the course are not present at all in the file used as input by gpubreport, so the -n option cannot override their exclusion.