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 当前在线
上尉
for /f "delims=" %%a in (temp.txt) do ( for /f "skip=21" %%b in (%%a.txt) do ( set str=%%b echo,!str:~0,3! )>std_%%a.txt )复制代码
@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复制代码