
| Quote: | |
|
CODE: [Copy to clipboard]findstr /g:sed.ini YourFileToSearch
CODE: [Copy to clipboard]@echo off&setlocal EnableDelayedExpansion
set xs=0
set "var=sed -e "{s/aaa//;s/bbb//;s/ccc//g}" a.txt"
for /f "tokens=1* delims=:" %%a in ('findstr /n .* a.txt') do set num%%a=%%b
for /f "delims=" %%a in ('%var%') do (
set /a str+=1
call set uew=%%num!str!%%
if "!uew!"=="%%a" set /a xs=1
)
echo 共有 !xs! 行含有指定字符.
pause
| Quote: | |
|
| Quote: | |
|
| Quote: | |
|
G:\>type sed.ini
perl
sed
first
G:\>type test.txt
this is a perl test
something to use sed
www.cn-dos.net/forum
my first important filter is the Great GNU sed
javascript
G:\>findstr /g:sed.ini test.txt
this is a perl test
something to use sed
my first important filter is the Great GNU sed
G:\>
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |