Line-end agnostic diff?

后端 未结 7 1724
醉梦人生
醉梦人生 2021-01-01 14:19

I\'m working on a Mac, with some fairly old files. Different files were created by different programs, so some of them end with \\r (Mac) and some with \\n (Unix). I want to

7条回答
  •  迷失自我
    2021-01-01 14:42

    If you use diff -w it will ignore whitespace in the files, which is probably sufficient for your needs.

    EDIT: just realized I misread the post the first time and you're actually looking for a diff that will work with \r line endings. My suggestion would be to convert the files with something like flip that can convert the files to a \n standard format.

    EDIT 2: Just found something that looks like what you want - Diff'nPatch:

    Diff'nPatch is a port to the Macintosh of the GNU 'diff', 'patch' and 'cmp' utilities. It lets you compare and find differences between two files or folders, collate two files, generate diffs in various formats (normal, context, unidiff, etc.), apply patches, compare files byte by byte. It can handle any type of line endings (mac, unix or windows)

提交回复
热议问题