保存为ANSI编码复制代码
- @echo off
- (for /f "tokens=* delims==- " %%i in ('find "中国" *.txt') do echo,%%i)>a.csv
- pause
用 findstr 便于匹配文件中多个关键词,如下式...复制代码
- @echo off &cd.>"结果.txt"
- for /f "delims=" %%F in ('dir /b/a-d *.txt *.lst') do (
- findstr /i "菠菜" "%%F">nul&&(echo,%%~nF&findstr /i "菠菜" "%%F")>>"结果.txt") 2>nul
- pause&exit/b
复制代码
- @echo off &cd.>"结果.txt"
- for /f "delims=" %%F in ('dir /b/a-d *.txt *.lst') do (
- findstr /i "菠菜 番茄 萝卜" "%%F">nul&&(echo,%%~nF&findstr /i "菠菜 番茄 萝卜" "%%F")>>"结果.txt") 2>nul
- pause&exit/b
欢迎光临 批处理之家 (http://www.bathome.net/) | Powered by Discuz! 7.2 |