Org Web Adapter

pages/generate_csv_diff_of_added_or_modified_rows_for_curaleaf.org

ID
93eea1cb-56c5-4656-80b7-f52a84eb96ae

Generate CSV diff of added or modified rows for Curaleaf

#+begin_src python

import sys

import csv

import csvdiff

old_file = sys.argv[1]

new_file = sys.argv[2]

out_file= sys.argv[3]

patch = csvdiff.diff_files(old_file, new_file, ['employee_id'])

with open(out_file, 'w', newline='') as file:

writer = csv.writer(file)

with open('curaleaf-2022-02-10.csv', 'r') as csvfile:

datareader = csv.reader(csvfile)

for row in datareader:

if str(row[0]) in diff_ids:

writer.writerow(row)

#+end_src