delab-1 当前离线
上等兵
for /f %%a in (temp.txt) do ( for /f "skip=21" %%b in (%%a.txt) do ( set str=%%b set F4=!str:~0,3! echo !F4! >>std_%%a.txt ) )复制代码
77七 当前离线
中校
TOP
aloha20200628 当前在线
少校
@echo off &for /f "delims=" %%a in (temp.txt) do ( (for /f "usebackq skip=21 delims=" %%b in ("%%~a.txt") do ( set "str=%%~b"&setlocal enabledelayedexpansion echo,!str:~0,3!&endlocal ))>"std_%%~a.txt" ) pause&exit/b复制代码
@echo off setlocal enabledelayedexpansion for /f %%a in (temp.txt) do ( if exist "%%a.txt" ( (for /f "useback skip=21" %%b in ("%%a.txt") do ( set str=%%b echo !str:~0,3! )) > "std_%%a.txt" ) ) pause复制代码
newswan 当前离线
上尉
awk '{for (i = 1; i <= 3; i++) {$i = substr($i, 1, 3)} print $1, $2, $3}' %%a.txt > out\%%a.txt复制代码
likeyou32 当前离线
列兵
hfxiang 当前在线
@echo off &for /f "delims=" %%a in (temp.txt) do if exist "%%~a.txt" grep -o "^..." "%%~a.txt">"std_%%~a.txt" pause&exit/b复制代码