|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Filtering the duplicates
Hello, I want to filter all the duplicates of a record to one place. Sample input and output will give you better idea. I am new to unix. Can some one help me on this? Input: Code:
7488 7389 chr1.fa chr1.fa 3546 9887 chr5.fa chr9.fa 7387 7898 chrX.fa chr3.fa 7488 7389 chr1.fa chr1.fa 7488 7389 chr21.fa chr3.fa 7488 7389 chr1.fa chr1.fa 9899 4577 chrX.fa chrM.fa 3546 9887 chr5.fa chr9.fa My desired output: Code:
7488 7389 chr1.fa chr1.fa 7488 7389 chr1.fa chr1.fa 7488 7389 chr1.fa chr1.fa 3546 9887 chr5.fa chr9.fa 3546 9887 chr5.fa chr9.fa 7387 7898 chrX.fa chr3.fa 7488 7389 chr21.fa chr3.fa 9899 4577 chrX.fa chrM.fa Thanks in advance,
Last edited by vbe; 06-27-2012 at 11:30 AM.. Reason: code tags please |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Code:
cat input | sort -k3,3 |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Code:
sort <input |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Duplicates in an XML file | TasosARISFC | Shell Programming and Scripting | 5 | 09-12-2011 03:51 PM |
| Duplicates | venkatesht | UNIX for Dummies Questions & Answers | 3 | 08-10-2010 08:02 AM |
| Non Duplicates | awk_beginner | Shell Programming and Scripting | 3 | 02-27-2009 08:50 AM |
| getting duplicates | megh | HP-UX | 4 | 09-14-2008 01:09 AM |
| lastlog has duplicates | chlawren | AIX | 1 | 06-19-2006 04:30 AM |
|
|