I want to count the second column lines for the identical first column values. O/p should be like:
kss23 4
fl67 3
fl66 5
nk45 2
So I would like to awk command to dynamically read all the 1st column name values and count 2nd column lines accordingly and throw the result as shown.
Telling us "none of your solution works" without telling us how they don't work gives us no way to help resolve your problem.
If Scrutinizer's suggestions printed diagnostic messages, what were they?
If Scrutinizer's suggestions produced no diagnostics and produced output different from what you wanted, what output did they produce?
Whenever you ask for help in these forums, it helps us help you if Scrutinizer tell us what operating system and shell you're using. If you're using a Solaris/SunOS system, Scrutinizer would have told you to change awk in both of his suggestions to /usr/xpg4/bin/awk or nawk . What operating system and shell are you using?