如何在Windows中比较两个csv文件

如何在Windows中比较两个csv文件

问题描述:

我需要比较Windows7中的两个csv文件。
我如何继续实现这一目标。我想看看两个文件之间的差异,就像我们可以在Linux中使用tkdiff一样。

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.

建议:


  • Windows + R 快捷方式以打开Windows的运行提示

  • 键入 cmd 并按 Enter 打开 DOS终端 cmd窗口

  • 通过运行命令 cd C:\path\to\your\directory 更改当前路径,以到达两个CSV文件的位置

  • 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

提示:将剪贴板中复制的路径粘贴到 DOS终端 cmd窗口,您可以(1)右键单击终端窗口,或(2)按 Shift + Insert

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.


  • 最后,要比较两个文件,请运行 fc filename1.csv filename2.csv> outfile.txt fc 代表文件比较)。

    该命令还将比较结果记录到位于同一文件夹中的文本文件 outfile.txt 。如果 outfile.txt 不存在,它将自动创建。

  • 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.