#!/usr/bin/perl -w use strict; use warnings; open(FH1,$ARGV[0]) or die "can not open\n"; open(FH2,$ARGV[1]) or die "can not open\n"; my @indx; while(){ my ($id,$seq)=split("\t",$_); push(@indx, $id,$seq); } my %hashseq=@indx; while(){ if($_=~m/^clus/){ my $clushead=$_; print "$clushead"; } else{ $_=~s/\t//g;$_=~s/\n//g; my $tes=$_; print $tes,"\t",$hashseq{"$tes"}; } }