Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by monkey_boy (Curate)
on Jan 04, 2007 at 13:34 UTC ( #592943=note: print w/ replies, xml ) Need Help??


in reply to Re^2: 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.

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...


Comment on Re^3: Find duplicate lines from the file and write it into new file.
Select or Download Code
Re^4: Find duplicate lines from the file and write it into new file.
by davidrw (Prior) on Jan 04, 2007 at 13:51 UTC
    uniq can give you the dups directly:
    sort foo.txt | uniq -d

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-09-22 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls