0
votes

Somebody please suggest me a tool to compare two text files and save the differences of the 2nd text file.

Example

I've two text files

file1.txt with following lines

line1 line2 line3 Line5

file2.txt with following lines

line1 line2 line3 line4

I want to compare these two files and save only the difference of 2nd text file.(ie, the output file contains "line4")

please suggest me a software to do this.

1

1 Answers

0
votes

hopes this will help

IEnumerable<string> strfile1 = File.ReadLines("file");
IEnumerable<string> strfile2 = File.ReadLines("file");
IEnumerable<string> strfile3 = strfile2.Except(strfile1);