0

I am trying to compare two files and get the output in another text file. So far I have checked and found only solutions to Unix or other OS, but I am looking for a Windows 10 solution.

These are what I have looked at so far:

Find the difference between two files

How to find difference between two text files in different directories in ubuntu os through command-line

https://www.howtogeek.com/206123/how-to-use-fc-file-compare-from-the-windows-command-prompt/

https://www.softwaretestinghelp.com/compare-two-files-unix/

https://superuser.com/questions/805522/compare-two-files-and-output-the-differences

This sort of work but not exactly:

fc D:\Logs\Allchannels.txt D:\Logs\check.txt > D:\Logs\missing.txt

The output this gives is a list of whats in both files, then the user will have to manually have to look at the files and find out the difference themselves.

What I want is a text file that only shows what's missing between the two.

Example of whats in the two fils:

file 1:

  • Cart

  • Box

  • Money

file 2:

  • Cart

  • Money

so the output on the 3rd file should be Box as this is the value that's missing.

A Person
  • 441
  • 7
  • 19

1 Answers1

0

You could use Git BASH https://gitforwindows.org/
and do similar to what you had, with this command:

git diff path/to/file-1 path/to/file-2 > diff.txt
barro32
  • 2,559
  • 23
  • 36
  • Hi, This again gives all the other information Although it has a - in front of the missing item it has other information, is there a way to clear it up – A Person Nov 01 '19 at 12:30
  • @@ -1,3 +1,2 @@ food -cart money \ No newline at end of file – A Person Nov 01 '19 at 12:30