CODE: [Copy to clipboard]
@echo off
for /f "tokens=1,2,3,4,5 delims==." %%a in (t.txt) do (
if /i "%%a"=="WksIP" call :ip %%b %%c %%d %%e
if /i "%%a"=="MAC" call :mac "%%b"
)
pause
goto :eof
:ip
set ip=%4
set /a ip+=1
echo wksIP=%1.%2.%3.%ip%
goto :eof
:mac
set mac1=
set mac=%~1
:loop
set mac1=%mac1%-%mac:~0,2%
set mac=%mac:~2%
if not "%mac%"=="" goto loop
echo MAC=%mac1:~1%
goto :eof
CODE: [Copy to clipboard]
@echo off
for /f "tokens=1,2,3,4,5 delims==." %%a in (t.txt) do (
if /i "%%a"=="WksIP" call :ip %%b %%c %%d %%e
if /i "%%a"=="MAC" call :mac "%%b"&call echo %%ip%% %%mac1:~1%%
)
pause
goto :eof
:ip
set ip=%4
set /a ip+=1
set "ip=%1.%2.%3.%ip%"
goto :eof
:mac
set mac1=
set mac=%~1
:loop
set mac1=%mac1%-%mac:~0,2%
set mac=%mac:~2%
if not "%mac%"=="" goto loop
goto :eof