|
So, this what I do. The content of the file is as follow:
try.txt
aa bb
bb aa
aa bb
bb aa
bb cc
cc bb
bb cc
zz ll
ll zz
zz ll
I did the usual sort command:
sort try.txt |uniq -c > try.sort
The content of try.sort is:
2 aa bb
2 bb aa
2 bb cc
1 cc bb
1 ll zz
2 zz ll
What I need is the output to be like this
aa bb 4
cc bb 3
zz ll 3
I think, the script should included, how to switch the data in the same order. For example:
zz ll
ll zz
zz ll
should be changed to
zz ii
zz ii
zz ii
Is there any clue for it? Tx
|