You are not logged in.
Hello all,
i need an batch script that compares two files like :
file1.txt :
DE_MCC
DE_REAL
PL_REAL
file2.txt
PL_MCC 89
RO_MCC 64
RU_MCC 11
TR_MCC 77
UA_MCC 96
PL_REAL 87
RO_REAL 63
RU_REAL 1
TR_REAL 78
UA_REAL 97
RO_RHM 62
BE_MCC 86
CN_MCC 70
EG_MCC 94
ES_MCC 66
FR_MCC 67
HU_MCC 84
KZ_MCC 95
NL_MCC 85
PT_MCC 93
DE_REAL 1
DE_MCC 11
the result must be:
DE_MCC 1
DE_REAL 11
PL_REAL 87
i tryed findstr but it didn't worked.
Thanks in advance for your help .
Offline
Try this: does it do what you need?
findstr /g:"file1.txt" "file2.txt"
Last edited by foxidrive (22 Jul 2014 14:49)
Offline
Hi Foxydrive,
thanks and if i must put the output into file3.txt ?
Offline
findstr /g:"file1.txt" "file2.txt" > "file3.txt"
Last edited by foxidrive (22 Jul 2014 14:48)
Offline
i tried like that and it didn't worked
FINDSTR: Cannot open file2.txt > file3.txt
Offline
copy and paste it again. Run it in the same folder as file1.txt and file2.txt
Offline
i did it like that
but i get that error.
the files are in the same directory.
Does file3.txt need to be created first ?
Offline
No. It works fine here.
Offline
findstr /g:"file1.txt" "file2.txt" > "file3.txt"
Try add ( and ):
(findstr /g:"file1.txt" "file2.txt") > "file3.txt"
.::{Honguito98}::.
Offline
Hi ,
it worked with parantheses,thanks a lot!
Offline