producer-script.py 339 B

123456789101112131415
  1. import os
  2. import pandas as pd
  3. from datetime import datetime
  4. # Update input csv files
  5. files = ["input-1.csv", "input-2.csv"]
  6. n = 2
  7. for file in files:
  8. n = n + 1
  9. print(file)
  10. input = pd.read_csv(file, header=0)
  11. input["lastupdated"] = datetime.now()
  12. input.to_csv("output-" + str(n) + ".csv", index=False)
  13. print(input)