It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center。
我有两个文件,我想从文件1中删除文件1的第3列不等于文件2的第2列的行。
文件1看起来像
1111 1111 exm-IND1-200449980 I I
1111 1111 exm-IND1-201453487 I I
1111 1111 rs4477212 A A
1111 1111 rs3094315 A A
1111 1111 exm-IND11-102094357 D D
文件2看起来像
1 rs4477212 0 82154
1 rs3094315 0 752566
1 rs3131972 0 752721
1 exm2268640 0 762320
1 rs12562034 0 768448
所需的文件输出将是
1111 1111 rs4477212 A A
1111 1111 rs3094315 A A
文件1是2.4GB,文件2是21.8MB。
提前谢谢你的帮助。
最佳答案
awk 'NR==FNR {f2[$2]; next} $3 in f2' file2 file1
关于python - 如果文件1中的A列与文件2中的B列不相等,则删除行[closed],我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17024498/
10-13 09:19