Many of the grading programs allow you to apply their actions to just a subset of the student records in a grades file. This can be done by specifying either a subset to be included, or a subset to be omitted (or "excluded"), or both.
You state your selection criteria by means of command-line options, and this page describes the options that are available.
Here are the available command-line options. As you read about them, bear in mind that inclusion options override omission options. To have an omission option that cannot be overridden, you will need to filter your grades file through gselect first; this makes a copy of your file that simply does not contain any records that were not selected.
Suppose we're working with a grades file called "example" containing these mark definitions and student records:
a1 / 10 a2 / 10 a3 / 10 a4 / 10 123456789 Alice 10 10 L 10 10 123456790 d Brian 5 5 5 5 123456791 x Carla 0 10 0 10We'll use the command "gpr -H -T -M", which prints the student records, without header, statistics or mark names.
Command: gpr -H -T -M example
Output -- all the students:
123456789 Alice 10 10 L 10 10 123456790 d Brian 5 5 5 5 123456791 x Carla 0 10 0 10
Command: gpr -H -T -M -d example
Output -- all but Brian, who seems to have dropped the course:
123456789 Alice 10 10 L 10 10 123456791 x Carla 0 10 0 10
Command: gpr -H -T -M -ox example
Output -- all but Carla, who is flagged 'x':
123456789 Alice 10 10 L 10 10 123456790 d Brian 5 5 5 5
Command: gpr -H -T -M -O example
Output -- nobody!
Command: gpr -H -T -M -O -ix example
Output -- only Carla, who is marked 'x', and not the others, because
we used a -O option:
123456791 x Carla 0 10 0 10
Command: gpr -H -T -M -n a example
Output -- only Brian and Carla, because "Alice" doesn't contain 'a':
123456790 d Brian 5 5 5 5 123456791 x Carla 0 10 0 10
Command: gpr -H -T -M -# 8 example
Output -- only Alice, because her student number contains '8':
123456789 Alice 10 10 L 10 10
Command: gpr -H -T -M -v a2=10 example
Output -- only Carla, whose mark for a2 is exactly "10":
123456791 x Carla 0 10 0 10
Command: gpr -H -T -M -v a2~10 example
Output -- Alice and Carla, both of whom have marks for a2 that contain "10":
123456789 Alice 10 10 L 10 10 123456791 x Carla 0 10 0 10
Command: gpr -H -T -M -v "a2=10 L" example
Note the use of quotation marks in the command line
to have the argument string contain a blank.
Output -- only Alice, whose mark exactly matches "10 L":
123456789 Alice 10 10 L 10 10
For a further example -- less complicated, but more practical in the sense that you will certainly encounter it at the end of your course -- see the page for gen.
The old version of the grading programs did not provide selection options.