我正在尝试从大表中删除行,但条件是一列有一个值而另一列有其他值。
到目前为止,我一直在尝试这个,但我想我没有正确地组合awk ..
awk '$11 !="1"'| awk '$20==2 || $20==3' infile.txt >out.txt
代码可能过于简单但无论如何都应该工作..或者不是吗?
由于
编辑:
这就是表格的样子
5306083 TGATCAATCTCATAAC[A/C]AAAAAAAAA consensus_24 211 1 species 0 0 0 T 0 7 T recommended 0.708 F 0 -100 T recommended
5193751 AGTAGCTTGCGCGGA[C/T]GGGGGGGGG consensus_32 227 1 species 0 0 0 T 1 1 T not_recommended 0.75 F 0 -100 T not_recommended
5193254 TAAAAAAAAAAAAAA[G/T]ATTCATCC consensus_26 192 1 species 0 0 0 T 1 0 T not_recommended 0.726 F 0 -100 T neutral
因此,如果我根据$ 11 = 1和$ 20过滤需要“中立”或“not_recommended”我会得到这个
5306083 TGATCAATCTCATAAC[A/C]AAAAAAAAA consensus_24 211 1 species 0 0 0 T 0 7 T recommended 0.708 F 0 -100 T recommended
答案 0 :(得分:1)
internal sealed class Configuration : DbMigrationsConfiguration<ProjectName.DAL.myDbcontext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
AutomaticMigrationDataLossAllowed = false;
}
protected override void Seed(ProjectName.DAL.myDbcontext)
{
}
}
应该这样做。
UPDATE:根据给定的输入,你应该在输出中得到两行
awk '$11!=1 && ($20==2 || $20==3)' infile.txt > out.txt
但是我想,你的意思是你想要否定这个与你原来的帖子不同的内容
$ awk '$11==1 && ($20=="not_recommended" || $20=="neutral")' file
5193751 AGTAGCTTGCGCGGA[C/T]GGGGGGGGG consensus_32 227 1 species 0 0 0 T 1 1 T not_recommended 0.75 F 0 -100 T not_recommended
5193254 TAAAAAAAAAAAAAA[G/T]ATTCATCC consensus_26 192 1 species 0 0 0 T 1 0 T not_recommended 0.726 F 0 -100 T neutral