diff options
-rwxr-xr-x | csv-hasher.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/csv-hasher.py b/csv-hasher.py index e3f71e5..fe206f8 100755 --- a/csv-hasher.py +++ b/csv-hasher.py @@ -106,7 +106,11 @@ class CsvHasher: df.columns = sample.columns # Hashing the column - df[self.args.colname[0]] = self.apply_hash(df) + try: + df[self.args.colname[0]] = self.apply_hash(df) + except KeyError as e: + print('Column not found: ' + self.args.colname[0]) + exit (1) # Writing the new CSV output df.to_csv(self.args.outfile[0], index=False, mode='a', header=write_header) |