How to compare two csv files in windows

前端 未结 3 1760
一向
一向 2020-12-30 06:11

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.

3条回答
  •  佛祖请我去吃肉
    2020-12-30 06:44

    Here is another option which I found very useful, as mentioned here:

    findstr /v /g:"file1.csv" "file2.csv"

    Where the /v switch returns the differences and /g: gets the search strings from file1.csv. You can use findstr /? for more help.

    You can also print the differences to a file using:

    findstr /v /g:"file1.csv" "file2.csv > diffs.csv"

    As an aside, I found findstr far more accurate and the output more readable than fc.


    UPDATE
    This works nicely with 'smaller' files. You might get an out of memory error on larger files. In this case, I've had to turn to Python and dataframes. Just a friendly heads up ...

提交回复
热议问题