[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?



On Fri, 31 Mar 2023 davidson wrote:

Some elaboration on my first take.

On Fri, 31 Mar 2023 Susmita/Rajib wrote:
My dear illustrious leaders and senior debian-user list-members,

I neglected to notice the proper subset of readers on whom you
intended to inflict your request.

I tried diffuse,

I see that diffuse has quite a number of features:

 diffuse - graphical tool for merging and comparing text files
  Diffuse is a graphical tool for merging and comparing text
  files. Diffuse is able to compare an arbitrary number of files
  side-by-side and gives users the ability to manually adjust
  line-matching and directly edit files. Diffuse can also retrieve
  revisions of files from bazaar, CVS, darcs, git, mercurial,
  monotone, Subversion and GNU Revision Control System (RCS)
  repositories for comparison and merging.

Which of these features do you *require*?

but it appears to me that it suffers from a limitation so far as my
need is concerned. It compares files by lines and line numbers, so
I can't use word-wrap

By "word-wrap", do you mean you need to break *lines* into smaller
lines (so that your screen can accomodate their content)?

Or do you mean instead that you are dealing with words so long that
some words won't fit within a single line on your screen until you
turn them into smaller words by inserting newlines.

to have the differences between two files within the program window
without venturing out to the right within the two file windows.

I see (from its package description above) that diffuse can display
files' content side-by-side. Is this a requirement of yours?

Because if it is not, you can double your effective screen width by
simply discarding the side-by-side feature.

$ diff <(fmt file1) <(fmt file2)

fmt has a -w option to adjust the max line width. The default is 75.

If I may say so myself, this is almost certainly not a helpful
solution. How embarrassing.

Start here instead:

 $ diff file1 file2

It displays the differences, and your terminal will wrap lines (and
break words) to fit the window for you.

Does it do what you want?

Is there a way to Word Wrap? Am I making a mistake here? Which program
would be the best suited for my work for comparing text files?

It depends on your precise requirements, which we cannot know until
you tell us what they are. (Sometimes one does not know oneself. This
is also okay.)

I don't believe you have specified any of your requirements that the
solution above does not provide.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin


Reply to: