-2
我想从包含“ExprControl”或“5p3pAssays”或“Fusion”的文件中捕获行。从文件中过滤行
但是,我想跳过同时包含“Fusion”和“NoCall”的行。我如何正确省略这些行?下面的代码不能跳过同时包含“Fusion”和“NoCall”的行。谢谢。
...
open my $in_fh, '<', $full_tsv_file
or die qq{Unable to open "$full_tsv_file" for input: $!};
while (<$in_fh>) {
next if /^#/;
next if /\b(?:Fusion&NoCall)\b/;
next unless /\b(?:ExprControl|5p3pAssays|Fusion)\b/;
my @fields = split('\t');
my $location = $fields[$location_col]; $location =~ s/"//g;
...
对不起,我有一个错字。你的方法运作良好。 – user3781528