J
Jie
Hi,
I have a STUDENT_CLASS_FILE like below, basically a two column table
student1 class_A
student2 class_A
student3 class_B
.....
now if someone gives me a class list, how I could generate the student
lists for each class?
I thought that I could use a code like below, but I don't know exactly
what to write for the third row...
Jie
################# MY PERL CODE#############3
while (STUDENT_CLASS_FILE) {
($student, $class) = split
push @{$STUDENT_CLASS_HASH{$class}} ,$student ????????????
}
foreach $class (@CLASS_LIST) {
$students = join ("," @{$STUDENT_CLASS_HASH{$class}} )
print "$classs, $student\n"
}
I have a STUDENT_CLASS_FILE like below, basically a two column table
student1 class_A
student2 class_A
student3 class_B
.....
now if someone gives me a class list, how I could generate the student
lists for each class?
I thought that I could use a code like below, but I don't know exactly
what to write for the third row...
Jie
################# MY PERL CODE#############3
while (STUDENT_CLASS_FILE) {
($student, $class) = split
push @{$STUDENT_CLASS_HASH{$class}} ,$student ????????????
}
foreach $class (@CLASS_LIST) {
$students = join ("," @{$STUDENT_CLASS_HASH{$class}} )
print "$classs, $student\n"
}