Gen calculates the values of marks that are derived from other marks. That is, it calculates "calculated marks" from "raw marks", in the terminology of the description of the file format.
gen [selection options] [files]
Gen calculates all the marks for all the students in the grades file, except those who are excluded by the selection options.
If no files are specified, input comes from the standard input and output goes to the standard output. Otherwise, the values of marks stored in the named files are updated.
When you need to calculate final marks for a course so that you can submit them to the Faculty of Arts and Science, you have some problems (which I imagine affect instructors in other faculties, and indeed other universities):
gen -d myFilewhere we assume your grades file is called "myFile".
But when you try to use gsub to put your marks into the Faculty's mark submission file, you discover that you have students who may have dropped the course in fact, but who officially have not dropped it, and for whom you must submit grades. These are the students from point (2), and you can arrange to calculate their marks either by removing their drop indicators, or -- better -- by picking a flag characer such as 'x' to flag them as apparent dropouts whose marks you have to submit. Then calculate the marks like this:
gen -d -ix myFileYou can use the same set of selection options with gsub.
And the students from point (3)? Those are the ones who did all the work you required in the course, but somehow never enrolled. You can handle these cases in two ways:
There are two major changes: