-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