Re: eliminating duplicate lines in a file

2001-05-02 Thread cherukuwada subrahmanyam
. ta, >From: Casey West <[EMAIL PROTECTED]> >To: "M.W. Koskamp" <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED], cherukuwada subrahmanyam <[EMAIL PROTECTED]>, >[EMAIL PROTECTED] >Subject: Re: eliminating duplicate lines in a file >Date: Wed, 2 May 2001 1

Re: eliminating duplicate lines in a file

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 11:11:20AM -0700, Paul wrote: : : --- "M.W. Koskamp" <[EMAIL PROTECTED]> wrote: : > > : open FH, "lines.txt" || die $!; : > > : my %uniq; : > > : map{$uniq{$_}=1 and print $_ unless $uniq{$_} }; : : lol -- one better(ish): : print map { $uniq{$_} ? '' : $uniq{$_}=$_

Re: eliminating duplicate lines in a file

2001-05-02 Thread Paul
--- "M.W. Koskamp" <[EMAIL PROTECTED]> wrote: > > : open FH, "lines.txt" || die $!; > > : my %uniq; > > : map{$uniq{$_}=1 and print $_ unless $uniq{$_} }; lol -- one better(ish): print map { $uniq{$_} ? '' : $uniq{$_}=$_ } ; #:op __ Do You Ya

Re: eliminating duplicate lines in a file

2001-05-02 Thread M.W. Koskamp
- Original Message - From: Casey West <[EMAIL PROTECTED]> To: M.W. Koskamp <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; cherukuwada subrahmanyam <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 6:45 PM Subject: Re: eliminating duplic

Re: eliminating duplicate lines in a file

2001-05-02 Thread Timothy Kimball
brahmanyam <[EMAIL PROTECTED]> wrote: : > Hi, : > Iam reading flat text file of 10 lines. Each line has got data of : > maximum 10 characters. : > I want to eliminate duplicate lines and blank lines out of that file. : > i.e. something like sort -u in unix. : : Got plenty of memory? =o) : :

Re: eliminating duplicate lines in a file

2001-05-02 Thread Casey West
On Wed, May 02, 2001 at 07:39:03PM +0200, M.W. Koskamp wrote: : : - Original Message - : From: Paul <[EMAIL PROTECTED]> : To: cherukuwada subrahmanyam <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> : Sent: Wednesday, May 02, 2001 7:08 PM : Subject: Re: eliminating duplica

Re: eliminating duplicate lines in a file

2001-05-02 Thread M.W. Koskamp
- Original Message - From: Paul <[EMAIL PROTECTED]> To: cherukuwada subrahmanyam <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 02, 2001 7:08 PM Subject: Re: eliminating duplicate lines in a file > > --- cherukuwada subrahmanyam <[EMAI

Re: eliminating duplicate lines in a file

2001-05-02 Thread Paul
--- cherukuwada subrahmanyam <[EMAIL PROTECTED]> wrote: > Hi, > Iam reading flat text file of 10 lines. Each line has got data of > maximum 10 characters. > I want to eliminate duplicate lines and blank lines out of that file. > i.e. something like sort -u in unix. Got plenty of memory? =o)

Re: eliminating duplicate lines in a file

2001-05-02 Thread Sean O'Leary
At 07:57 AM 5/2/2001, you wrote: >Hi, >Iam reading flat text file of 10 lines. Each line has got data of >maximum 10 characters. >I want to eliminate duplicate lines and blank lines out of that file. >i.e. something like sort -u in unix. > > > >Is there any easy way of doing it in perl??? >th

Re: eliminating duplicate lines in a file

2001-05-02 Thread Greg Meckes
You can try this old trick: # where @data is from flatfile %seen = (); @uniq = (); #will contain only unique elements foreach $item(@data) { unless($seen{$item}) { $seen{$item} = 1; if ($item =~ /\S+/g) { push(@uniq,

eliminating duplicate lines in a file

2001-05-02 Thread cherukuwada subrahmanyam
Hi, Iam reading flat text file of 10 lines. Each line has got data of maximum 10 characters. I want to eliminate duplicate lines and blank lines out of that file. i.e. something like sort -u in unix. Example: if the file contains: abcdef  dfsdf abcdef dfsdf 12334 Then the output should be: