I have two files. I want to read each line from file1 and check if it matches with any line in file2. I want this to repeat for each line in file1, and print the line number of file1 whose match was found in file2. So far I have this. It works for test files of 4-5 lines each but when working on large files of over 60k lines, I am getting a blank output
num=0
f1 = open('pdataf.txt', 'r')
f2 = open('splitc.txt', 'r')
fo = open('op.txt', 'w')
for line1 in f1:
for line2 in f2:
num=num+1
if line1==line2:
nummy=str(num)
fo.write(nummy)
fo.write('\n')
break
continue
f1.close()
f2.close()