how to match row names of two files quickly using python
Now I have two files, file1 has a column of names as shown below(billions of lines):
file2 also has the column of names and some other information(not all names in file1 show up in file2, but all names in file2 show up in file1):
file2 like this:
Now I want to fill file1 with the second column of file2, if the name is not in file2, then fill 0 in that row in file1, the result should be like this:
Because there are billions of lines in each file, is there any way to do this very quickly? Thanks!
• 16 views