I would just rjust
each element individually and ''.join
them:
''.join(elem.rjust(8) for elem in (i,j))
Or to write it all out:
def join_line(line_iter):
"""
Take a iterable containing strings and right justify each
at 8 spaces before joining
"""
return ''.join(elem.rjust(8) for elem in line_iter)
with open('output','w') as f:
f.writelines((join_line(row)+'\n') for row in csv_file)