I am trying to count the number of entries in column 2 for the same column1 and also number of times the first entry in column2 for similar column1 occur.
For example my input TSV file is:
C1 NC01 NC01 C2 NC01 NC01 NC02 C3 NC01 NC02 NC03
And my desired output is:
C1 NC01 2 2 NC01 C2 NC01 3 2 NC01 NC02 C3 NC01 3 1 NC02 NC03
How can I do this using command-line?