toodahlou

csv DictReader Error

Jul 11th, 2022
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import os
  2. from pathlib import Path
  3. import csv
  4.  
  5. # Script for creating PDF Manuals
  6.  
  7. # Define your username
  8. # Enter your Bergkamp username enclosed in single quotes.
  9. # This is case-sensitive. It must exactly match the name of your USERS folder.
  10. # Ex: 'melb'
  11. username = 'libbyl'
  12.  
  13. # Define TempManuals path
  14. tempmanuals_path = Path(r'F:/USERS/' + username + '/TempManuals')
  15.  
  16. # Set TempManuals path as current working directory
  17. os.chdir(tempmanuals_path)
  18.  
  19. # Import Job Materials list to a dictionary
  20. # Must exactly match name of csv file exported from Infor CSI
  21. with open('ToExcel_JobMaterials.csv', 'r') as csvfile:
  22. job_materials = csv.DictReader(csvfile, delimiter='\t')
  23.  
  24. for row in job_materials:
  25. print(row)
Advertisement
Add Comment
Please, Sign In to add comment