-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diff
: add option/flag for headers in output
This implements a new option for `diff`: It is now possible to decide, whether the CSV headers in the compared CSVs should be in the diff output. If neither CSVs have headers and this option is _not_ active (which means the output _should_ have headers), the `all_generic` strategy from `rename` is used (`_col_1`, `_col_2`, etc.). Example 1 (no diff, no headers in result): csv_left.csv col1,col2,col3 1,foo,bar csv_right.csv 1,foo,bar qsv diff --no-headers-result --no-headers-right csv_left.csv csv_right.csv Output: <nothing will be printed here, because there are no differences and we don't want to print headers in the result> ------------------------------------------------------------------------ Example 2 (has diff, no headers in result): csv_left.csv col1,col2,col3 1,foo,bar csv_right.csv 1,foo,baz qsv diff --no-headers-result --no-headers-right csv_left.csv csv_right.csv Output: -,1,foo,bar +,1,foo,baz ------------------------------------------------------------------------ Example 3 (has diff, add generic headers): csv_left.csv 1,foo,bar csv_right.csv 1,foo,baz qsv diff --no-headers-left --no-headers-right csv_left.csv csv_right.csv Output: diffresult,_col_1,_col_2,_col_3 -,1,foo,bar +,1,foo,baz
- Loading branch information
Jan Riemer
committed
Oct 31, 2023
1 parent
8aa2b58
commit ff47297
Showing
1 changed file
with
58 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters