from datetime import datetime
filepath = 'hoge.csv'
with open(filepath, encoding='utf-8') as f:
for row in f:
columns = row.split(',')
x1 = columns[0].strip()
x2 = int(columns[1].strip())
x3 = datetime.strptime(columns[3].strip(), '%Y-%m-%d %H:%M:%S')
with open('output/timecard.log', 'a', encoding='utf-8') as f:
# 書き込み
f.write(write_string)