fa2tab.pl 238 B

1234567891011121314151617181920
  1. #!/usr/bin/perl -w
  2. #
  3. use strict;
  4. my $name;
  5. my $seq = '';
  6. while(<>){
  7. if(/>(\S+)/){
  8. print "$name\t$seq\n" if(defined $name);
  9. $name = $1;
  10. $seq = '';
  11. } else {
  12. chomp;
  13. $seq .= $_;
  14. }
  15. }
  16. print "$name\t$seq\n" if(defined $name);
  17. 1;