http://qs1969.pair.com?node_id=513459


in reply to Re^2: Private Utilities
in thread Private Utilities

no problem!! round robin is fine - here is a way I have done it in a liner without having to read the entire file into mem (just an example) :
# Choose first N FASTA records perl -ne 'BEGIN {$/=">";$o=0}{chomp;$o<N?(/^$/?next:print">$_"):last;$ +o++}' EXAMPLE.fa
example usage:
perl -ne 'BEGIN{$/=">";$o=0}{chomp;$o<22?(/^$/?next:print">$_"):last; +$o++}' b4x_est100.fa # print the first 22 records