두 개의 텍스트 파일을 비교하고 결과를 새 파일에 저장해야합니다. 이 코드는 도움이되지 않습니다.두 개의 텍스트 파일을 비교하고 결과를 새 파일에 저장해야합니다.
findstr /vixg:oldstatus.txt newstatus.txt > diff.txt
단지 newstatus.txt의 출력을 제공합니다. 그것은 차이를 보이지 않습니다.
두 개의 텍스트 파일을 비교하고 결과를 새 파일에 저장해야합니다. 이 코드는 도움이되지 않습니다.두 개의 텍스트 파일을 비교하고 결과를 새 파일에 저장해야합니다.
findstr /vixg:oldstatus.txt newstatus.txt > diff.txt
단지 newstatus.txt의 출력을 제공합니다. 그것은 차이를 보이지 않습니다.
어쩌면이 findstr
명령으로 도움을
@echo off
for /f %%a in (oldstatus.txt) do (
findstr /i /v /c:"%%a" newstatus.txt >>diff.txt
)
pause
을? : : http://ss64.com/nt/findstr.htm
참조 : http://ss64.com/nt/fc.htm
과 : http://ss64.com/nt/comp.htm이
당신은 두 파일의 차이를 보여주기 위해 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.
PowerShell을 옵션입니다 :
? –fc /?
의 출력에서