unique.txt
文件包含:2列,列之间用tab分隔。
total.txt
文件包含:3列,每列用tab分隔。你知道吗
我从unique.txt
文件中获取每一行,并在total.txt
文件中找到它。
如果存在,则从total.txt
中提取整行,并将其保存在新的输出文件中。你知道吗
###Total.txt
column a column b column c
interaction1 mitochondria_205000_225000 mitochondria_195000_215000
interaction2 mitochondria_345000_365000 mitochondria_335000_355000
interaction3 mitochondria_345000_365000 mitochondria_5000_25000
interaction4 chloroplast_115000_128207 chloroplast_35000_55000
interaction5 chloroplast_115000_128207 chloroplast_15000_35000
interaction15 2_10515000_10535000 2_10505000_10525000
###Unique.txt
column a column b
mitochondria_205000_225000 mitochondria_195000_215000
mitochondria_345000_365000 mitochondria_335000_355000
mitochondria_345000_365000 mitochondria_5000_25000
chloroplast_115000_128207 chloroplast_35000_55000
chloroplast_115000_128207 chloroplast_15000_35000
mitochondria_185000_205000 mitochondria_25000_45000
2_16595000_16615000 2_16585000_16605000
4_2785000_2805000 4_2775000_2795000
4_11395000_11415000 4_11385000_11405000
4_2875000_2895000 4_2865000_2885000
4_13745000_13765000 4_13735000_13755000
这是我的python脚本
但它不提供期望输出(满足if条件的第1列的值)。 我觉得好像唯一.txt==第i个总计.txt 然后写下第i行总计.txt导入新文件
这应该能奏效。你知道吗
相关问题 更多 >
编程相关推荐