The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
merging similar columns in a single line file
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
merging similar columns in a single line file
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
05-28-2009
devtakh
Registered User
Join Date: Oct 2007
Location: Bangalore
Posts: 514
Code:
awk '{k=$2;a[k]=a[k]"\t"$1}END{for(k in a)print k,a[k]}' OFS="\t" filename
-Devaraj Takhellambam
devtakh
View Public Profile
Find all posts by devtakh
Find devtakh's past nominations received
Find devtakh's present nominations given