计算和比较单词 [英] Counting and comparison of words

查看:84
本文介绍了计算和比较单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好:

我正在尝试用VB.NET编程。我是比较新的编程

我有两个文本文件

文本文件1:

a1

a1

b1



文本文件2:

a1

b1



我需要报告其中一个'a1'已删除在文本文件中2

任何帮助表示赞赏!



谢谢



我尝试过:



你好:

我试图用VB.NET编程。我是比较新的编程

我有两个文本文件

文本文件1:

a1

a1

b1



文本文件2:

a1

b1



我需要报告其中一个'a1'已删除在文本文件中2

任何帮助表示赞赏!



谢谢

Hello:
I am trying to program this in VB.NET. I am relatively new to programming
I have two text files
Text file 1:
a1
a1
b1

Text file 2:
a1
b1

I need to report that one of 'a1's is deleted in text file 2
Any help is appreciated !

Thanks

What I have tried:

Hello:
I am trying to program this in VB.NET. I am relatively new to programming
I have two text files
Text file 1:
a1
a1
b1

Text file 2:
a1
b1

I need to report that one of 'a1's is deleted in text file 2
Any help is appreciated !

Thanks

推荐答案

HI,



试试这个:





try this:

Dim directory As [String] = "C:\Whatever\"
Dim linesA As [String]() = File.ReadAllLines(Path.Combine(directory, "FileA-Database.txt"))
Dim linesB As [String]() = File.ReadAllLines(Path.Combine(directory, "FileB-Database.txt"))

Dim onlyB As IEnumerable(Of [String]) = linesB.Except(linesA)

File.WriteAllLines(Path.Combine(directory, "Result.txt"), onlyB)


这篇关于计算和比较单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆