open(INFH, "<filename.txt"); my @data=<INFH>; close(INFH); open(OUTFH, ">outfile.txt"); my %hashdata = (); foreach my $thisline (@data) { $hashdata{$thisline} = 1; } foreach my $thisline (sort(keys(%hashdata))) { print(OUTFH, $thisline) } close(OUTFH);
In reply to Re: Removing repeated lines from file
by Anonymous Monk
in thread Removing repeated lines from file
by matth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |