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 ) )复制代码
newswan 当前离线
上尉
awk '{for (i = 1; i <= 3; i++) {$i = substr($i, 1, 3)} print $1, $2, $3}' %%a.txt > out\%%a.txt复制代码
TOP
77七 当前在线
中校
@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复制代码
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 )复制代码