I need to read a lines from two files. Extract data from the first line of file A and compare it with each line in file B. When I'm done with file B, I have to read next line in file A and compare it with all lines in file B, and so on ans so forth. I tried to use file.readline(), but when I use a while, it only prints the last line
import sys
def ReadFile():
name1='RoutingTable.txt'
try:
arch_table= open(name1,'r')
except IOError:
print 'Cannot Open', name1
sys.exit()
while True:
route=arch_table.readline()
print route
if not route:
break
pass