Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Detecting duplicate entries

by merlyn (Sage)
on Mar 01, 2001 at 22:08 UTC ( [id://61600]=note: print w/replies, xml ) Need Help??


in reply to Re: Detecting duplicate entries
in thread Detecting duplicate entries

That'd be a useless use of both cat and uniq.
sort -u file.txt

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Detecting duplicate entries
by turnstep (Parson) on Mar 01, 2001 at 22:13 UTC
    And to do it all at once as an inline edit:
    sort -uo file.txt file.txt

    Update: For those that asked, sort -u file.txt > file.txt
    will completely and happily change file.txt into a zero byte file, hence the need for the "o" flag.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://61600]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found