Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show row number or fixed column in diff #180

Open
watho opened this issue Mar 4, 2022 · 4 comments
Open

Show row number or fixed column in diff #180

watho opened this issue Mar 4, 2022 · 4 comments

Comments

@watho
Copy link

watho commented Mar 4, 2022

Hi,

is it possible to always show a column in the diff? I am comparing excel sheets with 10.000 rows and more and need the line number for context. Otherwise it is impossible to know where the difference inside the sheet is.

@paulfitz
Copy link
Owner

paulfitz commented Mar 4, 2022

Do you have a lot of columns @watho? If not too many --all-columns might be adequate - it will turn off pruning of unchanged columns.

@watho
Copy link
Author

watho commented Mar 4, 2022

Yes, over 50. That's not an option.

Thx for the quick answer.

@paulfitz
Copy link
Owner

paulfitz commented Mar 4, 2022

Hmm it has been a while since I looked at this, but I'd have expected the leftmost columns to be shown by default. Is line number an explicit column in your diff? If not, the --index flag may be what you are looking for, it makes the row and column mappings explicit, and the row mappings include corresponding row numbers in the two tables:

$ daff --index data.csv data2.csv
@:@,   ,A:A,B:B,...,I:I,J:J
   ,@@ ,a  ,b  ,...,i  ,j
   ,...,...,...,...,...,...
2:2,   ,101,2  ,...,9  ,10
3:3,→  ,103,2  ,...,9  ,10→100

@watho
Copy link
Author

watho commented Mar 4, 2022

Somehow i missed this option and created my own rownumber column. Looking at the code the --index flag correspondents to the flag always_show_order on CompareFlags, right? I will try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants