Amanda'blog

Thursday, January 8, 2015

合并第一列相同的行(转)

awk '{a[$1]=a[$1]?a[$1]" "$2:$2}END{for(i in a) print i,a[i]}'

合并第一列相同的行。

必须先sort
Posted by Amanda.xin.wen at 12:01 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2019 (2)
    • ►  June (1)
    • ►  January (1)
  • ▼  2015 (7)
    • ►  April (1)
    • ►  February (3)
    • ▼  January (3)
      • 简单好用的在线作图网站processon
      • 用EXCEL計算student's t test之p value(转)
      • 合并第一列相同的行(转)
  • ►  2014 (8)
    • ►  December (2)
    • ►  April (5)
    • ►  March (1)
  • ►  2013 (20)
    • ►  October (2)
    • ►  July (2)
    • ►  April (1)
    • ►  March (5)
    • ►  February (5)
    • ►  January (5)

About Me

Amanda.xin.wen
View my complete profile
Simple theme. Powered by Blogger.