We have the following code:
If Not File.Exists(trancheDataPath & sDealName & ".txt") OrElse (trancheInsert <> File.ReadAllText(trancheDataPath & sDealName & ".txt")) Then
File.WriteAllText(trancheDataPath & sDealName & ".txt", trancheInsert)
End If
We have a string of data that we want to compare with the content in the file and see if there is any change/difference in the new data. Currently, I am using the following method to do this:
trancheInsert <> File.ReadAllText("E:\Stored.txt")
where trancheInsert is of string type and contains the new data.
Similar to above code mentioned, there are similar pieces of code to write to 15 files in a function being called parallely, which occupies a lot of memory.
So,is there a better,faster and memory-efficient way than the above method being used to compare the data?