I wrote this short script to automatically print out strings in csv that contains "1|1". However, when I added in the if status=='1|1', the indentation error happened. I'm quite new to this, anyone can help?
inputfile = csv.reader(open('varStatus__case2_2Np_2N_hd1_Fx8Np_3L.csv','r'))
outputfile = open('errorlist.txt','w')
i=0
for row in inputfile:
if (i > 5):
name = row[1]
status = row[0]
if (status == '1|1'):
print >>outputfile, name, status
i+=1
I'm using python on UNIX
Aucun commentaire:
Enregistrer un commentaire