Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- due_dict = {}
- missing_ids = []
- with open('CLIO_TASKS.csv', mode='r', newline='', encoding='utf-8') as CLIO_TASKS:
- for clio_line in CLIO_TASKS:
- clio_line = clio_line.split(",")
- task_id = clio_line[0][1:-1]
- due_date = clio_line[3]
- due_dict[task_id] = due_date
- CLIO_TASKS.close()
- print("dictionary created!\n")
- dict_keys = due_dict.keys()
- def find_due_date(orig_id):
- if orig_id in dict_keys:
- return due_dict[orig_id]
- else:
- missing_ids.append(orig_id)
- return "0"
- out_date = ""
- with open('MVS_TASKS.csv', mode='r', newline='',encoding='utf-8') as MVS_TASKS,\
- open('MVS_TASKS_JOINED.csv', mode='a', newline='', encoding='utf-8') as MVS_TASKS_JOINED:
- MVS_TASKS.readline()
- for line in MVS_TASKS:
- line_holder = line
- line = line.split(", ")
- engagement_id = line[0]
- out_date = find_due_date(engagement_id)
- print(out_date)
- MVS_TASKS_JOINED.write(line_holder.strip() + out_date.strip() + "\n")
- MVS_TASKS_JOINED.close()
- MVS_TASKS.close()
- with open('MISSING.txt', mode='a') as MISSING:
- MISSING.write(''.join(missing_ids))
- MISSING.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement