Skip to content

Commit

Permalink
detect csv file change
Browse files Browse the repository at this point in the history
  • Loading branch information
davedavemckay committed Jul 2, 2024
1 parent 07c5604 commit 96b0c73
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/compare_csv_file_lists.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import argparse
import subprocess

parser = argparse.ArgumentParser(description="Compare CSV file lists in a log folder.")
parser.add_argument("--path", '-p', help="Path to the log folder", required=True)
Expand Down Expand Up @@ -31,5 +32,12 @@ def compare_csv_file_lists(log_folder, ds):

print(csv_files)

cmp_out = subprocess.run([f'cmp {log_folder}/{csv_files[0]} {log_folder}/{csv_files[1]}'].split(), capture_output=True, text=True)

if cmp_out.stdout != "":
print("CSV files have changed!")
else:
print("CSV files are the same.")

if __name__ == "__main__":
compare_csv_file_lists(log_folder, datestamp)

0 comments on commit 96b0c73

Please sign in to comment.