I am quite new to python3 and I am sure my question is very basic. I have been looking online for some help and the closest I got came from thread Find Common Region in two CSV File in PYTHON
However in my case it seems it is not iterating through everyline and stop at the first one. SO in my first csv I have 2 lines, lets say:
A,1,A1
B,2,B2
now in my second csv I have a thousand lines, something like
A,1,B5
A,2,A2
B,2,C6
B,3,C7
C,3,D7
C,4,D8
......
my code is as follow:
read1 = csv.reader(csv1)
for row1 in read1:
read2 = csv.reader(csv2)
for row2 in read2:
if row1[0] == row2[0] and row1[1] == row2[1]:
print('There is a match', row1[0], row1[1])
However, my output is There is a match A 1 It only finds the first match and not the other matche: B 2 I am not sure what is wrong in my iterations:
Thank you in advance for your help