in reply to Re: Removing partially duplicated lines from a file
in thread Removing partially duplicated lines from a file
I am still working on it.... Trying to adapt some code I used earlier. It doesn't vaguely work!
sub removeDuplicatesFromOutputText { my $origfile = $_[0]; # eg. HLA-A_0_HBe_for_8_sids.txt; my %hTmp; my $outfile; my $tempout; open (IN, $origfile); while (my $line = <IN>) { if ($line =~ /^\s+\d+/){ next if $line =~ m/^\s*$/; } $line=~s/^\s+//; $line=~s/\s+$//; $tempout = qq{$line\n} unless ($hTmp{$line}++); $outfile .= $tempout; } return $outfile; }
|
|---|