English 中文(简体)
如何分散改写的案文?
原标题:How to diff rewrapped text?

编辑文件 我总是坚持某种最长为80或150人的宽度,这取决于我所写的内容(代码、案文等)。 如果我只改动一个段落,那么现在多行将有所不同,以适合特定线宽度。 我怎么去看,实际变化不是改写的手法?

Example, textwidth=30: enter image description here

The actual changes are rather tiny:

  • line 9 insert: "Now I change a little"
  • line 15 insert: "Fill in here something and write totally new stuff with much more lines. "
  • line 18 change: s/Duis/TYPO/

我在这里使用(g)微调剂,如果其他软件能够达到所期望的放大作用,那是毫无道理的。

Of course software is designed to wrap automatically when text reaches window borders, so I also tried to use just line breaks in the end of a paragraph. The reason why this is not good is, that automatically diffs are line based, and for small changes in paragraphs I get the whole line, meaning then the whole paragraph as diff update :(.

最佳回答

GNU wdiff ,没有区别对待空间和新线。 人们甚至可以找到自己的亲子文件(例如here)。

$ cat file1
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Aenean vel molestie
nulla. Pellentesque placerat lacus vel
eros malesuada tristique. Nulla vitae
volutpat justo. Donec est mauris,

$ cat file2
Lorem amet, consectetur adipiscing some
inserted text! elit. Aenean vel molestie
nulla. Pellentesque placerat lacus vel
eros malesuada replacement. Nulla vitae
volutpat justo. Donec est mauris,

$ wdiff file1 file2
Lorem [-ipsum dolor sit-] amet, consectetur
adipiscing {+some inserted text!+} elit. Aenean vel molestie
nulla. Pellentesque placerat lacus vel
eros malesuada [-tristique.-] {+replacement.+} Nulla vitae
volutpat justo. Donec est mauris

([-...-] >为删除案文,{+...... +} 插入案文。

(re are other diff programmes that do a similar matter: e.g. adiff, and maybe some of the those listed in https://stackover.com/questions/12625/best-d-d-d-tool)

问题回答

我喜欢Beyond compare ,用于这种旁边档案比较。 此外,请你进行倍数比较和比值一级的比较,并且你可以右翼挑选左手档案比较,然后选择右手;或选择两个文档和右翼比较,以便两者取而代之。

“entergraph

I use DiffMerge 在许多平台上是免费的。

“enterography





相关问题
XML Diff: How to generate XML diff using XSLT?

I would like to compute the diff between two XML files or nodes using XSL/XSLT. Is there any stylesheet readily available or any simple way of doing it?

diff/merge tool for TortoiseSVN within Visual Studio

We ve recently "upgraded" from Visual SourceSafe to SVN based on recommendations on this site. Our current source control set-up is: TortoiseSVN with VisualSVN. We re very happy with it so far, but I ...

How do I get each comp result?

I would like to check diffs and when files are not same,stop compare files. Compare any files C:/UML/reports/* and C:/UML/Test/*. In this two directory has same file names and also aim is to want to ...

Find differences between 2 HTML files

Is there a way to display differences between two HTML documents? There is a PHP class called daisdiff, but it has no documentation. Can anyone show how to use it, or any alternative?

How to specify different --strip (-p) levels for patch?

If I have a diff that has paths like these: --- a/b/foo/bar/baz.pl +++ c/foo/bar/baz.pl Is there a way to tell the patch utility that the diff roots are at different levels? i.e. -p2 for one, yet -...

热门标签