避免 findstr 进入循环的方案:- @echo off
- for /f "delims=" %%a in (1.txt) do (
- for /f "tokens=2 delims==-" %%b in ("%%a") do (
- echo %%b %%a>>2.txt
- echo %%b>>3.txt
- )
- )
- dir /s /b e:\*.pdf>4.txt
- for /f "delims=" %%a in ('findstr /eg:2.txt 4.txt') do (
- set str=%%~na
- setlocal enabledelayedexpansion
- for /f "tokens=1*" %%b in (3.txt) do (
- if "!file:%%b=!" neq "!file!" move "d:\pdf\%%c.pdf" "%%~dpa"
- )
- )
- pause
复制代码
|