2017-02-03 1 views
0

두 개의 텍스트 파일을 비교하고 결과를 새 파일에 저장해야합니다. 이 코드는 도움이되지 않습니다.두 개의 텍스트 파일을 비교하고 결과를 새 파일에 저장해야합니다.

findstr /vixg:oldstatus.txt newstatus.txt > diff.txt 

단지 newstatus.txt의 출력을 제공합니다. 그것은 차이를 보이지 않습니다.

+0

PowerShell을 옵션입니다 : fc /?의 출력에서 ​​

fc oldstatus.txt newstatus.txt >diff.txt 

? –

답변

0

당신은 두 파일의 차이를 보여주기 위해 fc 명령을 사용할 수 있습니다 . /c 옵션은 findstr/i 옵션과 같이 대소 문자를 구분하지 않습니다. ?

당신이 실제로 결과 파일에서 볼 것으로 예상 무엇
Compares two files or sets of files and displays the differences between them 


FC [/A] [/C] [/L] [/LBn] [/N] [/OFF[LINE]] [/T] [/U] [/W] [/nnnn] 
    [drive1:][path1]filename1 [drive2:][path2]filename2 
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2 

/A   Displays only first and last lines for each set of differences. 
/B   Performs a binary comparison. 
/C   Disregards the case of letters. 
/L   Compares files as ASCII text. 
/LBn  Sets the maximum consecutive mismatches to the specified 
      number of lines. 
/N   Displays the line numbers on an ASCII comparison. 
/OFF[LINE] Do not skip files with offline attribute set. 
/T   Does not expand tabs to spaces. 
/U   Compare files as UNICODE text files. 
/W   Compresses white space (tabs and spaces) for comparison. 
/nnnn  Specifies the number of consecutive lines that must match 
      after a mismatch. 
[drive1:][path1]filename1 
      Specifies the first file or set of files to compare. 
[drive2:][path2]filename2 
      Specifies the second file or set of files to compare. 
관련 문제