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