in reply to 2 txt files comparison and sorting
You need a data structure to store, and lookup information.
I suggest using a hash:
After you read and split the first file, populate the hash:my %student ; # content should be <id> => <name>
When you read the grade, lookup and assign into the same structure:$student{$def[2]} = {FIRSTNAME=>$def[0], LASTNAME=>$def[1]};
(untested)$student{$def1[0]}{GRADE} = $def[1];
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
|
|---|