How to compare two csv files in windows

XYZ_Linux picture XYZ_Linux · Nov 4, 2015 · Viewed 66.6k times · Source

I need to compare two csv files in windows7. How can I proceed to achieve this. I want to see the differences in both the files , like we can use tkdiff in Linux.

Answer

user5524993 picture user5524993 · Nov 4, 2015

Suggestion:

  • Press Windows+R shortcut to open windows' Run prompt
  • Type in cmd and press Enter to open a DOS terminal cmd window
  • Change the current path by running the command cd C:\path\to\your\directory to reach the location of the two CSV files

Tip: To paste a copied path from clipboard into DOS terminal cmd window, you can either (1) right-click on terminal window, or (2) press Shift+Insert.

  • Finally, to compare the two files, run fc filename1.csv filename2.csv > outfile.txt (fc stands for "file compare").
    The command will also log the result of comparison into a text file outfile.txt located in the same folder. If outfile.txt doesn't exist, it will be created automatically.