Show entire lines with diff command

Hi,

When I run the diff command using diff -yt file1 file2, I get the output in which original lines are truncated.

I tried using -W switch with diff. However, that does not produce exact output as I want. Is it possible to show entire line of file1 and file2 in diff command's output?

Thanks in advance.

please provide the sample input files and expected output.

file1:
This is the first sample line in my file1, I want to see full content in the diff result.
file2:
This is the first sample line in my file2, I want to see full content in the diff result.

Current Result:

diff -yt file1 file2
This is the first sample line in my file1, I want to see full c |  This is the first sample line in my file2, I want to see full c

In the side by side difference view, I want:
This is the first sample line in my file1, I want to see full content in the diff result. | This is the first sample line in my file2, I want to see full content in the diff result.

You can use the -W or --width option. See the man page.

As I mentioned, -W doesn't produce exact output as I want. I want to preserve the alignment of original file and hence, have to use -yt.

I beg your pardon - I missed that in your original post.

Having said that, -W seems to give the desired output. What's wrong with the output of -W?

If I provide -W 250, I understand both the file's content will be adjusted in width of 125 characters, correct me if I am wrong. and if that's correct, then what about the files that have longer than 125 characters?

Yes, correct. So you can use a large value of -W, but that would leave whitespace at the end, that you don't want?

I couldn't see a way to remove that whitespace using diff alone.

diff -yt -W10000 file1 file2 | while read LINE; do echo $LINE; done

Thanks for the reply Scottn. What I am trying to do is produce a colorful side-by-side difference between two files. and for that, I am parsing the output of diff command and therefore, it is very important to have "|","<" and ">" occur at the same place throughout the diff result. Also, the additional spaces will make the end result ugly.