text:
192.168.0.1-254
-----------------------
要提取为ip段,开始数与结束数
就好这样:
ip段:192.168.0
开始数:1
结束数:254
注意开始数与结束数是变化的!
我的笨方法:
@echo off&SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=1,2* delims=-" %%i in (070612_S.txt) do (
set tmp=%%i
set end=%%j
for /f "tokens=1,2,3,4* delims=." %%a in ("!tmp!") do (
set ip=%%a.%%b.%%c
set start=%%d
echo/!start!
echo/!end!
echo/!ip!
)
)
[ Last edited by bjsh on 2007-7-31 at 03:05 PM ]
192.168.0.1-254
-----------------------
要提取为ip段,开始数与结束数
就好这样:
ip段:192.168.0
开始数:1
结束数:254
注意开始数与结束数是变化的!
我的笨方法:
@echo off&SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=1,2* delims=-" %%i in (070612_S.txt) do (
set tmp=%%i
set end=%%j
for /f "tokens=1,2,3,4* delims=." %%a in ("!tmp!") do (
set ip=%%a.%%b.%%c
set start=%%d
echo/!start!
echo/!end!
echo/!ip!
)
)
[ Last edited by bjsh on 2007-7-31 at 03:05 PM ]
