How to split command output in Windows command prompt?

后端 未结 2 505
青春惊慌失措
青春惊慌失措 2021-01-16 14:36

Is there a split command in Windows, to split command output? My command is:

ipconfig | findstr /i \"Default gateway\" | findstr [0-9]
         


        
2条回答
  •  离开以前
    2021-01-16 15:13

    there is not exactly a split function, but you can use FOR to accomplish what you want :

    for /f "tokens=2 delims=:" %%i  in ('ipconfig ^| findstr /i "Default gateway" ^| findstr [0-9]') do echo %%i
    

提交回复
热议问题