in reply to finding and deleting repeated lines in a file

read your file line by line to a hash where the sequence will be the hash keys. each line you read check if the key isn't already exist in the hash, if it is than continue with the next line. it should be something like this:
my ($line, %hash); while ($line = <FILE>) { if ($line =~ /(your_sequence_format)/) { if (! exists($hash{$1})) { $hash{$1} = $line; } } } # now you can print the hash back to your file


Thanks.

Hotshot

Replies are listed 'Best First'.
Re: Re: finding and deleting repeated lines in a file
by marvell (Pilgrim) on Jun 19, 2002 at 14:43 UTC
    That will, of course, change the order.

    --
    Steve Marvell

      not if you also save in the hash the row number where the sequence was found and sort it by the number before printing

      Thanks.

      Hotshot