Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    while (<>) {
        print if /^>?(\w+\n)/ && $names{$1};
    }
    
  2. or download this
    $ ./extract.pl file1 file2 >output
    
  3. or download this
    $ perl -ne'$/eq"\n"?$nm{$_}++:/^>?(\w+\n)/&&$nm{$1}&&print;$/="\n>"if 
    +eof' file1 file2 >output
    
  4. or download this
    $ perl -ne'1..eof&&($/=">")?${$_}++:/.+\n/&${$&}&&print' file1 file2 >
    +output