联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off echo.&set /p str=请输入你要排除的字符: if exist temp.txt (cd.>temp.txt) findstr /r /v "^.*%str%.*" test.txt >>temp.txt call temp.txt
Originally posted by lxmxn at 2008-2-19 20:15: 你这样应该可以了,试试。。。
@echo off findstr "2" test.txt|findstr "a">temp1.txt findstr /v /g:temp1.txt test.txt>temp.txt del temp1.txt temp.txt
@echo off echo.&set /p str=请输入你要排除的字符,多个字符格式例:abc def: call :xxx "%str%" call temp.txt pause exit :xxx if "%~1"=="" goto:eof if exist temp.txt (cd.>temp.txt) findstr /v "%~1" test.txt >>temp.txt goto:eof
Originally posted by fastslz at 2008-2-20 00:45: 语言表达确实不够清楚,是不是这意思? [code]@echo off echo.&set /p str=请输入你要排除的字符,多个字符格式例:abc def: call :xxx "%str%" call temp ...
@echo off echo.&set /p str=请输入你要排除的字符,多个字符格式例:abc def: set str=%str: =.*% call :xxx "%str%" call temp.txt pause exit :xxx if "%~1"=="" goto:eof if exist temp.txt (cd.>temp.txt) findstr /v "%~1" test.txt >>temp.txt goto:eof
Originally posted by terse at 2008-2-20 13:59: 我也来一个 不知道楼主是不是这个意思 @echo off if exist temp.txt (cd.>temp.txt) echo.&set /p str=请输入你要排除的字符 call :xxx %str% temp.txt pause exit :x ...
for /f "delims=" %%a in (t.txt) do (
for /f "delims=" %%a in (test.txt) do (
Originally posted by abcd at 2008-2-20 14:05: [code]@echo off echo.&set /p str=请输入你要排除的字符,多个字符格式例:abc def: set str=%str: =.*% call :xxx "%str%" call temp.txt pause exit :xxx if &q ...
@echo off & setlocal EnableDelayedExpansion set /p keywords=请输入关键字,用空格分开: copy test.txt tem_.txt for %%a in (%keywords%) do ( findstr "%%a" tem_.txt>tem1.txt del tem_.txt & ren tem1.txt tem_.txt ) findstr /v /g:tem_.txt test.txt > newfile.txt del tem_.txt start notepad newfile.txt