0

I reviewed the manual for "diff" and it says:

For many other programs newline is also a white space character, but diff is a line-oriented program and a newline character always ends a line. Hence the -w or --ignore-all-space option does not ignore newline-related changes; it ignores only other white space changes.

wdiff seems to be recommended from this answer: Ignore newlines with diff

but I can't find the right arguments in the man page of wdiff.

Community
  • 1
  • 1
JobHunter69
  • 1,706
  • 5
  • 25
  • 49
  • By default, a file "A", containing `1 2 3` will compare as "NOT EQUAL" to a file B with `1 2 3`. However, `diff -w A B` will compare as "EQUAL". Q: what exactly is it you want to do, that "diff -w" doesn't already do for you? – paulsm4 Sep 29 '16 at 23:51
  • 1
    Possible duplicate of [Ignore newlines with diff](http://stackoverflow.com/questions/13192890/ignore-newlines-with-diff) – paulsm4 Sep 29 '16 at 23:56
  • I couldn't find ignore newline arguments in wdiff, and it is not code I'm comparing so indent won't help – JobHunter69 Sep 30 '16 at 00:12
  • @paulsm4 `wdiff` does not have an option `-w` to ignore whitespace changes. OP and I would like to diff two files, ignoring whitespace differences and only highlighting the changes on a word-by-word, not line-by-line basis. This is especially useful if there are long lines with small changes. – Marcel Waldvogel Aug 11 '20 at 14:25
  • For code files (or other files which can be "normalised"), this answer from [Ignore newlines with diff](https://stackoverflow.com/a/13192954/2445204) is helpful: Normalise both files first, then run `wdiff` – Marcel Waldvogel Aug 11 '20 at 14:28

0 Answers0