Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Detecting duplicate entries

by merlyn (Sage)
on Mar 01, 2001 at 22:08 UTC ( #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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2022-08-10 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?