Macdadi112
Programmer
Hi,
I was wondering if you could help as I'm sure its possible. I can remember something was possible using sed/awk a while back.
I have a list in a file such as sample_list.txt which contains the following:
Code:
example1, answer1
example2, answer2
example3, answer3
example4, answer4
example5, answer5
example6, answer6
example7, answer7
example8, answer8
example9, answer9
example10, answer10
e.t.c
What I want to do is to create a script and when it runs:
1) it lists either the first or second field and places it on the left hand side
2) It then places its corresponding example/answer on the opposite side
3) It repeats this for 10 of the words and then shuffles the words
example:
Code:
example8 answer1
example10 answer6
example1 answer8
answer3 example5
example7 answer9
example9 answer7
answer2 answer9
example6 example3
example4 example2
answer5 answer4
Hope this helps.
Thanks
I was wondering if you could help as I'm sure its possible. I can remember something was possible using sed/awk a while back.
I have a list in a file such as sample_list.txt which contains the following:
Code:
example1, answer1
example2, answer2
example3, answer3
example4, answer4
example5, answer5
example6, answer6
example7, answer7
example8, answer8
example9, answer9
example10, answer10
e.t.c
What I want to do is to create a script and when it runs:
1) it lists either the first or second field and places it on the left hand side
2) It then places its corresponding example/answer on the opposite side
3) It repeats this for 10 of the words and then shuffles the words
example:
Code:
example8 answer1
example10 answer6
example1 answer8
answer3 example5
example7 answer9
example9 answer7
answer2 answer9
example6 example3
example4 example2
answer5 answer4
Hope this helps.
Thanks