使用方法:把文本拖到批处理上就行了。。。
@echo off
:: Code by oicu#lsxk.org 2007/11/29
rem chcp 437>nul
:: 看情况使用,utf-8编码的文件不能少了chcp命令,一般无需使用,
:: 但无论是否使用都不支持utf-16的文件。
:: pushd "%~dp1"
:: 如果不用pushd和popd,文件都要用绝对路径不能只用文件名。
if "%~1"=="" goto :EOF
set outputfile=%~dpn1_output%~x1
type nul>"%outputfile%"
echo Waiting...
for /F "tokens=1* delims=:" %%i in ('findstr /n .* "%~1"') do (
findstr /B /E /C:"%%j" "%outputfile%">nul 2>&1 || echo.%%j>>"%outputfile%"
)
pause
start "" notepad "%outputfile%"
:: popd
exit
评论