gannh 当前离线
上等兵
tmplinshi 当前离线
版主
TOP
@echo off&setlocal enabledelayedexpansion for /f "delims=" %%i in (1.txt) do ( set t=%%i >>2.txt echo !t:~,5!^|!t:~5,2!^|!t:~7,3!^|!t:~10,7!^|!t:~17,12!^|!t:~29,99! ) echo OK &pause复制代码
apang 当前离线
上将
@echo off for /f "delims=" %%a in ('dir /a-d /b *.txt') do ( (for /f "usebackq delims=" %%b in ("%%a") do ( set "str=%%b" setlocal enabledelayedexpansion set "a=!str:~,3!" set "b=!str:~3!" echo,!a!:!b! endlocal ))>$ move $ "%%a" ) pause复制代码
回复 tmplinshi 没有中文的,谢谢 gannh 发表于 2012-11-21 16:20
sed -i "s/./&:/3" *.txt复制代码
sed -i "s/.//4" *.txt复制代码