I guess, the last line in your file1 does NOT have new line
i.e. the line is just
At the same time the third line in file2 has new line, i.e. it is
So both lines are not equal.
You can strip the new line char from the lines before comparison. This will also take care of the extra blank line in your output between
i.e. the line is just
3
At the same time the third line in file2 has new line, i.e. it is
3\n
So both lines are not equal.
You can strip the new line char from the lines before comparison. This will also take care of the extra blank line in your output between
--1
and --2
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs