LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Show unique values with related data in one line (https://www.linuxquestions.org/questions/programming-9/show-unique-values-with-related-data-in-one-line-685065/)

cgcamal 11-20-2008 11:43 PM

Show unique values with related data in one line
 
Hello everyone,

Some help with this.

I have a file with many numbers repeated 2, 3, or sometimes 7 times in consecuitve lines
in column 1. Those numbers have a number related in column 2.

I would like to show only one time the repeated numbers in column 1 and put the numbers
related in column 2 joined in one line.

I have a pattern as follow:

(there are no blanks empty lines, I show like this to see better in this example)


Code:

72130000003        2
72130000003        31
72130000003        12

72130000007        4
72130000007        9
72130000007        11
72130000007        3

72131949999        5
72131949999        7
72131949999        9

I would like to obtain

Code:

72130000003 2 31 12
72130000007 4  9 11  3
72131949999 5  7  9

Thanks in advance for any help

burschik 11-21-2008 02:48 AM

Come on now. You keep asking for help with virtually identical problems. Aren't you going to learn anything from the suggestions made?


All times are GMT -5. The time now is 10:29 AM.