How to compare to text files using command line tools, under windows

5,496

Cygwin has a collection of unix tools that can be run on windows including "diff" which can produce some very "unverbose" output if used with the correct parameters

Share:
5,496

Related videos on Youtube

hyperknot
Author by

hyperknot

Updated on September 17, 2022

Comments

  • hyperknot
    hyperknot over 1 year

    I have to sorted files, say A.md5 and B.md5. I would like to write a small windows batch file, which returns the lines (in my case a list of files), which are present in A but not in B (not case sensitive). I don't need to use arguments; I would like to use it in an actual batch file.

    I tried

    fc A.md5 B.md5
    

    but the output is too verbose and there is no way to customise it to behave in a more minimal way. I know it’s possible to do it with find.exe, but I am not yet on a level in find.exe to be able to write this script. BTW, once I've seen a website which had hundreds of find.exe examples explained (I think a similar question was one of them), can you possibly point me to that site?

    • John Gardeniers
      John Gardeniers about 13 years
      Another homework question? How about you put in some effort of your own. Alternatively, if this isn't homework, learnt to use appropriate tools. This is absolutely trivial in Perl, as well as many other languages.
    • hyperknot
      hyperknot about 13 years
      Why would it be a homework question? I was thinking about comparing a huge list of files to a backup, and doing it by find.exe, but couldn't figure out myself. I think I will stay in the friendlier sites...
  • APR
    APR about 13 years
    The OP says he tried that, but that the output is too verbose.