
# extracts useful fields from prep_c2

#1 > 1054 > AAS > 209 > S04-05 > Cheryl A. Wall > > > > The Norton
#Anthology of African American Literature 2nd ed.  > Their Eyes Were
#Watching God > Quicksand > Black Boy > Invisible Man > Song of Solomon >
#> Approximately 150 - 200 pages of reading per week.  Attendance and
#class participation are mandatory.  Two short critical papers, 5-7
#pages.  > Y > > Y > > N > > Take-Home > A-F,P,Aud > 009558

#bolle% get_c2 prep/prep_c2.txt | sed 3q
#4225    AAS     209     S06-07  Pamela E. Barnett
#4226    AAS     340     S06-07  Anne A. Cheng
#4227    AAS     345     S06-07  Miriam J. Petty


awk '
BEGIN {
	FS = " *\t"
	OFS = "\t"
	id = 1
	dept = 3
	crsnumber = 4
	term = 5
	professor_1 = 6
	professor_2 = 7
	professor_3 = 8
	prereq = 9
}

$term ~ /S09-10/ {
	prof = $professor_1
	if ($professor_2) prof = prof ", " $professor_2
	if ($professor_3) prof = prof ", " $professor_3
	print $id, $dept, $crsnumber, $term, prof, $prereq
}

' $*
