2
4 Comments

How can I compare two files with code? What tools do you know?

How can I compare two files with code? What tools do you know?

on June 13, 2019
  1. 3

    The most ubiquitous tool is diff which is available on pretty much any stock Mac or Linux installation. You can also parse the outputs with code, and there are libraries for multiple languages. This assumes you're comparing text files. diff can still compare binary files, but the output pretty much just tells you that they're different.

    You can also get diff for windows via the GNUWin32 project. http://gnuwin32.sourceforge.net/packages/diffutils.htm

    1. 1

      There are like a million different "visual diff" tools. So probably use one of them.

  2. 1

    Just to add few not mentioned:
    sdiff, vimdiff
    Araxis Merge
    Beyond Compare

  3. 1

    Recently I found great file compare tool. It is Code Compare https://www.devart.com/codecompare/file-comparison.html This file comparison tool that allows you to compare, diff and merge text files or folders. It can recognize basic code structure in various languages (namely C#, C++, JavaScript, Java, Visual Basic). Very comfortable!