The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-02-2009
anjas anjas is offline
Registered User
  
 

Join Date: Mar 2009
Location: Bali, Indonesia
Posts: 17
counting the data in column

Hi power user,

I have data as follows

aa bb
bb aa
aa bb
bb aa
bb cc
cc bb
bb cc
zz ll
ll zz
zz ll

and I want the output to be like this:

aa bb 4
cc bb 3
zz ll 3

So, althrough the data in the column are arranged in a different order, they will be considered the same data. Is there any awk script which could do that? Tx