From The Compiler, 7 Years ago, written in Python.
Embed
  1. #!/usr/bin/python3
  2. # vim: set fileencoding=utf-8 tabstop=8 expandtab shiftwidth=4 softtabstop=4 :
  3.  
  4. import csv
  5. import dateutil.parser
  6. import time
  7.  
  8. lines = []
  9.  
  10. with open('in.csv', 'r') as f:
  11.     reader = csv.reader(f)
  12.     lines = list(reader)
  13.  
  14. with open('out.csv', 'w') as f:
  15.     writer = csv.writer(f)
  16.     for line in lines:
  17.         line[6] = int(time.mktime(dateutil.parser.parse(line[6]).timetuple()))
  18.     writer.writerows(lines)