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.
#!/usr/bin/perl -w use strict; use warnings; my %duplicates; while (<DATA>) { print if !defined $duplicates{$_}; $duplicates{$_}++; } __DATA__ The quick red fox jumped over the lazy brown dog. Time flies like an arrow, fruit flies like a banana. Time flies like an arrow, fruit flies like a banana. Now is the time for all good men to come to the aid of their party. The quick red fox jumped over the lazy brown dog. The quick red fox jumped over the lazy brown dog. Time flies like an arrow, fruit flies like a banana. Now is the time for all good men to come to the aid of their party. Now is the time for all good men to come to the aid of their party.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Find duplicate lines from the file and write it into new file.
by PerlInMyBlood (Initiate) on Jun 28, 2011 at 08:56 UTC | |
by choroba (Cardinal) on Jun 28, 2011 at 09:17 UTC |