Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('test.csv', 'r') as f:
- for line in f:
- line = line.strip('\n')
- name, surname, birthdate, city = line.split(';')
- d, m, y = birthdate.split('.')
- d = d.rjust(2, '0')
- m = m.rjust(2, '0')
- birthdate = ".".join((d, m, y))
- print("{:12}{:12}{:12}{}".format(name, surname, birthdate, city))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement