how to get unique values set from a repeating values list

Posted by Mariselvam on Stack Overflow See other posts from Stack Overflow or by Mariselvam
Published on 2011-02-12T07:39:55Z Indexed on 2011/02/14 7:25 UTC
Read the original article Hit count: 125

Filed under:
|
|
|

I need to parse a large log file (flat file), which contains two column of values (column-A , column-B).

Values in both columns are repeating. I need to find for each unique value in column-A , I need to find a set of column-B values.

Is this can be done using unix shell command or need to write any perl or python script? What are the ways this can be done?

Example:

xxxA 2
xxxA 1
xxxB 2
XXXC 3
XXXA 3
xxxD 4

output:

xxxA - 2,1,3
xxxB - 2
xxxC - 3
xxxD - 4

© Stack Overflow or respective owner

Related posts about python

Related posts about perl