file 1
A
B
C
file 2
B
C
D
file1 + file2 =
A
B
C
D
Is it possible to do using cmd.exe?
If you can affort to use a case insensitive comparison, and if you know that none of the lines are longer than 511 bytes (127 for XP), then you can use the following:
@echo off
copy file1.txt merge.txt >nul
findstr /lvxig:file1.txt file2.txt >>merge.txt
type merge.txt
For an explanation of the restrictions, see What are the undocumented features and limitations of the Windows FINDSTR command?.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With