larsyencken / csvdiff

Generate a diff between two tabular datasets expressed in CSV files.
BSD 3-Clause "New" or "Revised" License
132 stars 31 forks source link

Not able to use multiple keys #49

Open jainshagun opened 5 years ago

jainshagun commented 5 years ago

not getting option to use multiple keys'-k':

Usage: csvdiff [OPTIONS] INDEX_COLUMNS FROM_CSV TO_CSV

Compare two csv files to see what rows differ between them. The files are each expected to have a header row, and for each row to be uniquely identified by one or more indexing columns.

Options: --style [compact|pretty|summary] Instead of the default compact output, pretty-print or give a summary instead -o, --output PATH Output to a file instead of stdout -q, --quiet Don't output anything, just use exit codes --sep TEXT Separator to use between fields [default: comma] -i, --ignore-columns CSV a comma seperated list of columns to ignore from the comparison --significance INTEGER Ignore numeric changes less than this number of significant figures --help Show this message and exit.

larsyencken commented 5 years ago

Oh, it's not optional to given an index column, that's why it's not in the options. You can comma-separate them to specify more than one. Like "csvdiff firstname,lastname a.csv b.csv". Try that!

On Tue, 20 Nov 2018 at 12:11, jainshagun notifications@github.com wrote:

not getting option to use multiple keys'-k':

Usage: csvdiff [OPTIONS] INDEX_COLUMNS FROM_CSV TO_CSV

Compare two csv files to see what rows differ between them. The files are each expected to have a header row, and for each row to be uniquely identified by one or more indexing columns.

Options: --style [compact|pretty|summary] Instead of the default compact output, pretty-print or give a summary instead -o, --output PATH Output to a file instead of stdout -q, --quiet Don't output anything, just use exit codes --sep TEXT Separator to use between fields [default: comma] -i, --ignore-columns CSV a comma seperated list of columns to ignore from the comparison --significance INTEGER Ignore numeric changes less than this number of significant figures --help Show this message and exit.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/larsyencken/csvdiff/issues/49, or mute the thread https://github.com/notifications/unsubscribe-auth/AACMrA-D_TKOswQS6On6Vlgmn2AGE7-Zks5uw-NjgaJpZM4Yq4eC .

simbo1905 commented 5 years ago

Testing this is seemed to work fine. Perhaps this should be closed as a stale issue? Thanks

 2019-05-22 05:38:55 ⌚  |2.4.4| MacBook-Pro-3 in ~/projects/csvdiff
± |master ?:27 ✗| → cat m_a.csv 
a,b,c,d
1,1,2,3
1,2,3,4
2,1,5,6
2,2,7,8

 2019-05-22 05:39:06 ⌚  |2.4.4| MacBook-Pro-3 in ~/projects/csvdiff
± |master ?:27 ✗| → cat m_b.csv 
a,b,c,d
1,1,2,3
1,2,3,44
2,1,5,6
2,2,7,8

 2019-05-22 05:39:09 ⌚  |2.4.4| MacBook-Pro-3 in ~/projects/csvdiff
± |master ?:27 ✗| → csvdiff --style=summary a,b m_a.csv m_b.csv 
0 rows removed (0.0%)
0 rows added (0.0%)
1 rows changed (25.0%)

 2019-05-22 05:39:14 ⌚  |2.4.4| MacBook-Pro-3 in ~/projects/csvdiff