2
I have a tab-delimited text file containing data like
Col 1 Col 2
1 a
1 b
1 c
1 d
1 d
2 a
2 b
3 a
so on and so forth.
I would like to transform this structure into
a b c d
1 1 1 1 2
2 1 1 1 1
3 1 0 0 0
so that, a, b, c and d become columns; 1, 2 and 3 become a single row; and the numbers represent count. E.g. 1 has one "a" and two "d"s.
How can this be accomplished using awk or similar tools?
Welcome to Super User! The formatting here can definitely be confusing if you're new. Check out this guide. I fixed it for you this time. Good luck!
– Pops – 2012-08-09T22:24:32.040