求一个整理txt的BAT..........................
求一个bat整理sa的比如是14.96.89.112:1433[sa:qwerty]Time:391msec整理成14.96.89.112saqwerty求啊...
求一个bat 整理sa 的
比如是
14.96.89.112:1433 [sa:qwerty] Time:391 msec
整理成
14.96.89.112 sa qwerty
求啊 展开
比如是
14.96.89.112:1433 [sa:qwerty] Time:391 msec
整理成
14.96.89.112 sa qwerty
求啊 展开
展开全部
@echo off
::从1.txt中读取,整理为2.txt
setlocal ENABLEDELAYEDEXPANSION
set i=0
for /f "delims=" %%s in (1.txt) do (
set /a i+=1
set fl!i!=%%s
)
set j=0
cd.>2.txt
:loop
set state=0
set str=**
set /a j+=1
if %j% GTR %i% goto :eof
set k=-1
:loop2
set /a k+=1
call set t=%%fl%j%:~%k%,1%%
if "%t%"=="" goto :loop
if "%t%"=="*" set /a state+=1
if %state%==4 (
set state=0
echo %str%**>>2.txt
)
if %state%==2 if not "%t%"=="*" set str=%str%%t%
if not %state%==2 if not "%t%"=="*" (
set str=**
set state=0
)
goto :loop2
::从1.txt中读取,整理为2.txt
setlocal ENABLEDELAYEDEXPANSION
set i=0
for /f "delims=" %%s in (1.txt) do (
set /a i+=1
set fl!i!=%%s
)
set j=0
cd.>2.txt
:loop
set state=0
set str=**
set /a j+=1
if %j% GTR %i% goto :eof
set k=-1
:loop2
set /a k+=1
call set t=%%fl%j%:~%k%,1%%
if "%t%"=="" goto :loop
if "%t%"=="*" set /a state+=1
if %state%==4 (
set state=0
echo %str%**>>2.txt
)
if %state%==2 if not "%t%"=="*" set str=%str%%t%
if not %state%==2 if not "%t%"=="*" (
set str=**
set state=0
)
goto :loop2
追问
就生成个2.txt的文档.但里面什么都没有 求助啊
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询