Dear forum,
I know about the awk command but I am having a hard time putting it to use on a text file I have.
This text file has the following format:
Quote:
Name Test Score
Jennifer 1 60
Jennifer 2 79
Jennifer 3 30
Jennifer 4 50
Jennifer 5 70
Bob 1 30
Bob 2 60
Bob 3 20
Bob 4 90
Bob 5 80
Joe 1 80
Joe 2 60
Joe 3 60
Joe 4 70
Joe 5 70
...
|
I would like to make new text files for each of the test scores (5 total), such that the new text files look like the following:
Text file 1 for Test 1 scores
Quote:
Name Test Score
Jennifer 1 60
Bob 1 30
Joe 1 80
...
|
Text file 2 for Test 2 scores
Quote:
Name Test Score
Jennifer 2 79
Bob 2 60
Joe 2 60
...
|
etc.
Is there a way to do this using just awk or is there something else that would be needed? Can awk do sequence extraction... not sure if that's the right wording, what I mean is that every nth line is output (line 1, 6, 11, 16... to text file 1; lines 2, 7, 12, 17... to text file 2, etc.) rather than searching for value 2 in the second column and outputting those that match to text file 2. Hope this made some sense..
Thanks for your help! =)