Expects to be run as script < inputfile > outputfile#!/usr/bin/perl use strict; use warnings; while (<>) { chomp; $duplicates{$_}++; } foreach my $key (keys %duplicates) { if ($duplicates{$key} > 1) { delete $duplicates{$key}; print "$key\n"; } }
In reply to Re: Find duplicate lines from the file and write it into new file.
by shigetsu
in thread Find duplicate lines from the file and write it into new file.
by anna_here
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |