Question

I am using the following sdiff command to get the side-by-side difference of two files. Column width is given as one of the options

sdiff -w170 /tmp/captureFile /tmp/referenceFile (or diff -y )

if i use -w 130 then some characters are stripped. They do not appear in output even on next line. They are lost.

And if -w 170 is used then due to extra characters in the left column, right column is shifted and so few of its characters are seen in the left column part due to screen width being smaller.

So is there any option not to strip off the characters and have then on the next line in the same column of the sdiff command output?

Was it helpful?

Solution

What you are seeing (obviously) is either line truncation (-w 130) or line wrap (-w 170) relative to the line length in your terminal session. I don't believe there is an option to do what you desire. I've used sdiff a lot & tend to use a terminal/CLI that supports changing font sizes.

Shrink the font to something still readable & then maximise the window if possible.

Something else I've done is to 'fold' the two files before comparison to have a shorter line length - depends if you're on Linux or some Unix distro. but fold should be there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top