#!/usr/bin/perl -w $input_blast = $ARGV[0]; $/ = "\nQuery=\s+"; open (IN, "$input_blast"); while () { chomp; @blastblock = split(/Query=/, $_); } $total_number = 0; foreach $blastresult (@blastblock) { next if ($blastresult =~ /^BLASTN/); $total_number++; print "$total_number ----------------------$blastresult\n"; } #### Database: NLngoRT_WT_PCRDB 1 sequences; 481 total letters Query= M01133:26:000000000-A6UCG:1:1101:22656:1128 1:N:0:1+@M01133:26:000000000-A6UCG:1:1101:22656:1128 2:N:0:1 Length=501 ... (more content here, I deleted them so that this message is small) Query= M01133:26:000000000-A6UCG:1:1101:22656:1130 1:N:0:1+@M01133:26:000000000-A6UCG:1:1101:22656:1130 2:N:0:1 Length=501 ... (more content here, I deleted them so that this message is small) -------------