Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Find duplicate lines from the file and write it into new file.

by tinita (Parson)
on Jan 04, 2007 at 13:28 UTC ( [id://592940]=note: print w/replies, xml ) Need Help??


in reply to Re: Find duplicate lines from the file and write it into new file.
in thread Find duplicate lines from the file and write it into new file.

if sorting is an option, and we are on unix/linux here, i would try out sort -u file

update: yep, i misread the question. forget it =)

  • Comment on Re^2: Find duplicate lines from the file and write it into new file.
  • Download Code

Replies are listed 'Best First'.
Re^3: Find duplicate lines from the file and write it into new file.
by monkey_boy (Priest) on Jan 04, 2007 at 13:34 UTC
    but then you would lose the duplicates, i think the OP wanted to find the duplicates, perhaps somthing along the lines of sort | uniq -c , then they could read the file and look at the counts



    This is not a Signature...
      uniq can give you the dups directly:
      sort foo.txt | uniq -d

Log In?
Username:
Password:

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

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

    No recent polls found