Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: UNIX: remove duplicate lines

RE: UNIX: remove duplicate lines

From: jared still <jkstill_at_teleport.com>
Date: Wed, 3 Jan 2001 23:03:25 -0800 (PST)
Message-Id: <10730.125673@fatcity.com>


On Wed, 3 Jan 2001, Mohan, Ross wrote:

> "HP" -
>
>
> A PERL script would do it in about 3 lines ( excluding wrappers, etc. )
> Of course, TIMTOWTDI. (ask Jared!)
>

Well, since you mentioned it:

file uniq.pl:



#!/usr/bin/perl
my %h;

while(<>) {

        $h{$_}='';
}
print keys %h;

---

uniq.pl < test.txt


This works, but is probably much more
resource intensive than 'sort -u'



Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;)
jkstill_at_teleport.com
Received on Thu Jan 04 2001 - 01:03:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US