# -*- coding: utf-8 -*-
file1 = sys.argv[1]
file2 = sys.argv[2]
outfile = sys.argv[3]
outcon = open(outfile,"w")
dictfile1 = {}
with open(file1,"r") as file1liness:
file1lin = file1liness.readlines()
for file1lines in file1lin:
file1line = file1lines.strip().split("\t")
file1key = file1line[0]
file1apapos = file1line[1]
dictfile1[file1key] = file1apapos
with open(file2,"r") as file2liness:
file2lin = file2liness.readlines()
for file2lines in file2lin:
file2line = file2lines.strip().split("\t")
file2key = file2line[0]
file2apapos = file2line[1]
if file2key in dictfile1.keys():
fil1value = dictfile1[file2key]
outcon.write(str(file2key)+'\t'+str(fil1value)+'\t'+str(file2apapos)+'\n')
网友评论