in reply to creating a new file with unique values
perl -lne '/\tCM+(\d+)/; print $1 if defined $1 and not $seen{$1}++' f +ile1 > file2 [download]
-- John.