我的输入:
# BLASTN 2.13.0+
# Query: ;HaelonEVm219174t4;
# Database: /data1/IxoSca/Databases/nt/nt
# Fields: subject id, subject sci names, % identity, alignment length, mismatches, gap opens, evalue, bit score, % query coverage per hsp, subject title
# 1 hits found
gi|1962480099|emb|LR990882.1| Endotricha flammealis 80.702 57 11 0 0.043 54.5 10 Endotricha flammealis genome assembly, chromosome: 29
# BLASTN 2.13.0+
# Query: ;HaelonEVm2775195t2;
# Database: /data1/IxoSca/Databases/nt/nt
# Fields: subject id, subject sci names, % identity, alignment length, mismatches, gap opens, evalue, bit score, % query coverage per hsp, subject title
# 1 hits found
gi|2452922202|emb|OX438846.1| Eudonia truncicolella 88.372 43 3 1 0.009 53.6 29 Eudonia truncicolella genome assembly, chromosome: 21
字符串
我的代码:
}
elsif($line =~ m/\s[1] hit/){
print "1 hits found: ".$name."\n";
$flag=1;
}
型
我的输出:
HaelonEVm219174t4 1 hits found: # Query: ;HaelonEVm219174t4;
HaelonEVm2775195t2 1 hits found: # Query: ;HaelonEVm2775195t2;
型
我想打印下一行来代替 “找到1个匹配项:# Query:;HaelonEVm219174t4;“***
预期的输出:
HaelonEVm219174t4 LR990882.1 Endotricha flammealis 80.702 57 11 0 0.043 54.5 10 Endotricha flammealis genome assembly, chromosome: 29
HaelonEVm2775195t2 OX438846.1 Eudonia truncicolella 88.372 43 3 1 0.009 53.6 29 Eudonia truncicolella genome assembly, chromosome: 21
型
2条答案
按热度按时间xam8gpfp1#
当正则表达式匹配时,设置标志,但不打印该行的任何内容。设置标志后,打印当前行,然后清除标志。
字符串
印刷品:
型
0sgqnhkj2#
你在正确的轨道上设置一个标志。但不是立即打印,而是在标志为true时打印。
字符串
简化版:
型