#!usr/bin/perl use strict; open (FH,"hostR.txt")or die "cannot open a file \n"; open (FH1,">hostRR.txt")or die "cannot open a file \n"; local $/; my $fileData = <FH>; close FH; if ($fileData =~ s/(\w+\s\w+)\s*\1\s*\1/$1/gi){ print FH1 $fileData; } close FH1;
################ You can use the above regular expression to remove consecutive duplicates from your file
In reply to Re: Delete Duplicate Entry in a text file
by Anonymous Monk
in thread Delete Duplicate Entry in a text file
by astronogun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |