@echo off
set /p ip=Enter IP address
for /f "tokens=1,2 delims= " %%i in (test.txt) do (
if %ip%==%%i (echo %ip% %%j)
test.txt
192.168.0.4 00-1C-F1-00-65-7F
192.168.0.238 00-1C-F1-00-68-84
192.168.0.42 00-1C-F1-00-69-54
192.168.0.41 00-1C-F1-00-97-80
192.168.0.22 00-1C-F1-00-68-80
If the entered IP matches an IP in test, then display the corresponding IP and MAC. If it doesn't match, then continue to the next step...... How should this be written??
set /p ip=Enter IP address
for /f "tokens=1,2 delims= " %%i in (test.txt) do (
if %ip%==%%i (echo %ip% %%j)
test.txt
192.168.0.4 00-1C-F1-00-65-7F
192.168.0.238 00-1C-F1-00-68-84
192.168.0.42 00-1C-F1-00-69-54
192.168.0.41 00-1C-F1-00-97-80
192.168.0.22 00-1C-F1-00-68-80
If the entered IP matches an IP in test, then display the corresponding IP and MAC. If it doesn't match, then continue to the next step...... How should this be written??
