Hello people,
I have got a program that compares two text files.
C:\Paths.txt contains:
X:\archive\100-101\234234\123
X:\archive\100-101\234234\124
X:\archive\100-101\26564\125
X:\archive\100-101\254634\126
X:\archive\100-101\234534\127
X:\archive\100-101\2323434\128
and C:\OrderNames.txt contains:
123
124
126
128
I want now remove the entries from Paths.txt that doesn't exists in OrderNames.txt / add them to a list in vb that is ok too.
Result:
C:\Paths.txt contains:
X:\archive\100-101\234234\123
X:\archive\100-101\234234\124
X:\archive\100-101\254634\126
X:\archive\100-101\2323434\128
Could someone help me?
Thank you in advance
I have got a program that compares two text files.
Code:
Dim fileA = File.ReadAllLines("C:\Paths.txt")
Dim fileB = File.ReadAllLines("C:\OrderNames.txt")
Dim noAdress = String.Join(Environment.NewLine, fileB.Where(Function(b) Not fileA.Contains(b)))
Console.WriteLine(noAdress)
C:\Paths.txt contains:
X:\archive\100-101\234234\123
X:\archive\100-101\234234\124
X:\archive\100-101\26564\125
X:\archive\100-101\254634\126
X:\archive\100-101\234534\127
X:\archive\100-101\2323434\128
and C:\OrderNames.txt contains:
123
124
126
128
I want now remove the entries from Paths.txt that doesn't exists in OrderNames.txt / add them to a list in vb that is ok too.
Result:
C:\Paths.txt contains:
X:\archive\100-101\234234\123
X:\archive\100-101\234234\124
X:\archive\100-101\254634\126
X:\archive\100-101\2323434\128
Could someone help me?
Thank you in advance