[HPADM] Summery - Removing lines that are similar

From: Buddy Mills (ramill@wm.edu)
Date: Wed Jun 21 2006 - 12:48:19 EDT


Thanks to all that replied. There were so many solutions that I have not
had time to try them all. While many solutions worked the one I used was
from Kees Couprie.

assuming that positions 1-3 and 11-last are to be unique. (which they are
and will be)

    sort -u -k1.1,1.3 -k1.11, -u text.txt > unique.txt

Thanks for responses from Shyam Hazari, Atif Malik, Richard Wright, Bill
Thomson, Steve Evans, Brett Geer, Jon Fife and David Totsch.

Buddy Mills
The College of William and Mary
757-221-2099 ramill@wm.edu

> Scripting Question.
>
> I need to remove all "Duplicate" lines. However "Duplicate" line are
> different because of the trans number. In the example below (real text)
> the
> HFM line is a dup except for the position 4-10. But I need to remove one
> of
> them, I don't care if it is the 1st line or the second that I keep. Can
> someone give me a simple way to do this.
>
> HFM0032832930364864MCPChfmcco
> DZR0035287930463885RIPCdzrich
> ASR0037679930337329ROPCasroac
> HFM0034167930364864MCPChfmcco
> PXC0041660930413259CHPCpxchen
> JEL0067400930399164LEPCjelepc
> RHV0072730930372522VAPCRHVann
> ACG0077756930284248GUPCacguil
> JAV0080620930353818VAPCJavazq
> BAM0082019930439538MCPCbamcve
>
> Thanks,
>
> Buddy Mills
> The College of William and Mary
> 757-221-2099 ramill@wm.edu
>

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:53 EDT