The UNIX and Linux Forums  


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 -->
  #6 (permalink)  
Old 07-03-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
nawk -f an.awk myFile

an.awk:

Code:
{idx1=$1 OFS $2; idx2=$2 OFS $1}
{a[(idx2 in a)?idx2:idx1]++}
END { for (i in a) print i, a[i] }