Guest User

Untitled

a guest
Dec 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import csv
  2. from datetime import datetime
  3. import urllib
  4.  
  5. out = []
  6. in_file = raw_input("File path: ")
  7. with open(in_file) as f:
  8. reader = csv.reader(f)
  9. for row in reader:
  10. print row
  11. out.append([urllib.unquote(col).decode('utf-8').encode('utf-8') for col in row])
  12.  
  13.  
  14. affix = datetime.now().strftime('%Y_%m_%d__%H_%M_%S')
  15. with open('decoded_' + affix + '.csv', 'wb') as o:
  16. write = csv.writer(o)
  17. write.writerows(out)
Add Comment
Please, Sign In to add comment