I have a problem with my code - it doesnt enter the loop "for line in f2". This code is supposed to compare two files and if string in column 0 from one file matches the stiring in column 1 in second file write it down to the file.
Im a beginner with Python, so I have no idea what's wrong. I tried debugging but it didnt provide any help. Does anyone know what am I doing wrong?
f1=open("D:\\bowtie2\\posortowane_cale_test.csv","w")
with open("D:\\bowtie2\\dobazy228k_test.csv") as f:
for yy in f:
y=yy.split(";")
#print(y)
#sp1=y[1]
with open ("D:\\bowtie2\\zliczone_test.csv") as f2:
for xx in f2:
xx=xx[0:len(xx)-1]
x=xx.split(";")
for line in f2:
sp1=y[0]
sp2=x[1]
print("bb")
if sp1==sp2:
print("aaa")
f1.write(x[1]+";"+y[0]+"\n")#";"+x[1]+";"+x[2]+";"+x[3]+";"+x[6]+";"+x[7]+";"+x[8]+";"+sp1+"/"+sp2+"\n")
f2.close()
f.close()
f1.close()