C#中 - 如何比较两个不同的文本文件文本文件、不同、两个

由网友(啵啵桃汀)分享简介:在,有两个文本文件的情况下:FileA.txt测试1234测试FileB.txt测试5667池塘和所有出现FileA.txt将从FileB.txt被删除,被输出到FileC.txt 所以FileC.txt内容如下:5667池塘解决方案 File.WriteAllLines(FileC.txt。File...

在,有两个文本文件的情况下:

  FileA.txt
测试
1234
测试


FileB.txt
测试
5667
池塘
 

和所有出现FileA.txt将从FileB.txt被删除,被输出到FileC.txt

所以FileC.txt内容如下:

  5667
池塘
 
文本分割程序 V1.0.0.0绿色免费版下载

解决方案

  File.WriteAllLines(FileC.txt
  。File.ReadAllLines(FileB.txt)除(File.ReadAllLines(FileA.txt)));
 

In the case that there were two text files:

FileA.txt
test
1234
testing


FileB.txt
test
5667
pond

and all occurrences in FileA.txt would be removed from FileB.txt, being output into FileC.txt

So FileC.txt would read:

5667
pond

解决方案

File.WriteAllLines("FileC.txt",
  File.ReadAllLines("FileB.txt").Except(File.ReadAllLines("FileA.txt")));

阅读全文

相关推荐

最新文章