Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-20-2008, 11:43 PM   #1
Registered: Nov 2008
Location: Tegucigalpa
Posts: 78

Rep: Reputation: 16
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)

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

72130000003 2 31 12
72130000007 4  9 11  3
72131949999 5  7  9
Thanks in advance for any help
Old 11-21-2008, 02:48 AM   #2
Registered: Jul 2008
Posts: 159

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search values within multiple files line to line Chrizzieej Programming 5 09-26-2008 04:11 PM
set and env show values of what file(s)? xcore_on Linux - Newbie 4 05-30-2006 05:16 PM
phpinfo wont show updated values..Why??? Help rajnair0278 Linux - Software 13 03-22-2006 04:21 AM
HOWTO access Processor ID / other unique values?? kartheekpn Linux - Security 5 03-20-2005 04:10 AM
MySQL - UNIQUE values across two columns - non-standard constraint issue benr77 Linux - General 2 11-06-2004 10:48 AM > Forums > Non-*NIX Forums > Programming

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration