Hi,
Iam a novice to unix shell scripting, need a help from you guys.The scenario is as follows, i have the following Text file.
order No Company Category
21 aaa A
24 aaa A
87 aaa B
98 aaa B
23 abc A
45 abc B
25 bbb A
76 wes A
66 wes B
44 wes B
35 wes B
39 wes B
90 esd B
99 esd B
109 esd B
26 esd B
58 esd A
76 tre B
75 tre B
Desired Output is as follows(columns Count, A, B are the no of times they are repeated):
Company Count A B
aaa 4 2 2
abc 2 1 1
bbb 1 1 0
wes 5 1 4
esd 5 4 1
tre 2 0 2
The output should be in a different file. Appreciate your help.
That's a one-liner in name only. In the future, please use a reasonable coding style instead of such a long line. It will make your code easier for novices to understand, and members not using a 2560 pixel wide display will be able to read your post (and posts which quote your post) without having to resort to tedious horizontal scrolling.