simonw / csv-diff

Python CLI tool and library for diffing CSV and JSON files
Apache License 2.0
292 stars 47 forks source link

option to modify key before comparison #35

Open captn3m0 opened 1 year ago

captn3m0 commented 1 year ago

2 CSV files, with keys that have the same keys, but in a slightly different case. I'd like to run the keys through str.lower() somehow before the comparison is made.

Having this available as a custom hook for programmatic usage would be nice as well. (So I could define a custom key for #17 and #22 quite nicely as well).

Example CSVs where this is needed:

ID,Value
key1,value1
key2,value2
ID,Value
Key1,value11
Key2,value22