You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with io.open(args.i1, encoding='utf8') as in1_file, io.open(args.i2, encoding='utf8') as in2_file, io.open(args.o1, encoding='utf8', mode='w') as out1_file, io.open(args.o2, encoding='utf8') as out2_file:
valid_counter, all_counter = 0, 0
for l1 in in1_file:
l2 = in2_file.readline()
all_counter += 1
if len(l1.split(' ')) != len(l2.split(' ')): continue
out1_file.write(l1)
out2_file.write(l2)
valid_counter += 1
in1_file.close()
in2_file.close()
out1_file.close()
out2_file.close()
print '{} valid lines written out of {} total lines'.format(valid_counter, all_counter)