Post
Topic
Board Development & Technical Discussion
Re: python script compare lines in 2 text files and output matches
by
crofrihosl
on 24/09/2019, 14:31:44 UTC
#edit

Code:
import ecdsa, ecdsa.der, ecdsa.util, hashlib
import hashlib, os, re, struct
import bitcoin

f1=open("output","a") # f1=open("output","w")
firstfile= [line.rstrip('\n') for line in open("file1t")]
secondfile= [line.rstrip('\n') for line in open("file2")]

for firstline in firstfile:
  if firstline in secondfile:
    print >>f1, (firstline)