0

I'm trying to build an comparison script in C#.

Here a small example:

12 txt files in map A.

I'm having problems to figure out how to do this. I am trying to compare txt file X with all 12 txt files in map A. Also i want to compare by content and not by size etc.

I hope anyone can help me,

Niels

NielsSchutte
  • 55
  • 1
  • 9
  • 1
    Can you supply the code where you are having an issue, and details of any errors or unexpected results – Richard Boyce Sep 04 '17 at 13:35
  • 1
    Compare for what? What is your expected result? – Fildor Sep 04 '17 at 13:46
  • If you just are trying to compare files by content and don't care about what the difference is then maybe checksum comparison is your best option. But please be more specific with what type of difference you are looking for. – Johan Brännmar Sep 04 '17 at 13:54
  • I would compare by size first - if the size is not the same no further comparison needed. if the size is the same consinder using a checksum or hashsum algorithm and compare their results or do the comparison byte-by-byte or block-by-block. – Michael Sep 04 '17 at 14:27
  • check this: https://stackoverflow.com/questions/1358510/how-to-compare-2-files-fast-using-net – VDN Sep 04 '17 at 14:56

1 Answers1

1

If you only care that they are exactly the same you can use this answer here to do a MD5 file checksum.

File Checksum

Dakota Kincer
  • 448
  • 3
  • 16