Batch file to output last line of findstr

前端 未结 2 1671
一整个雨季
一整个雨季 2021-01-27 01:26

I am trying to find a list of machines in files in folders, and print out the last line of the output only.

@echo off
for /f %%a in (computers.txt) do findstr /x         


        
2条回答
  •  感动是毒
    2021-01-27 02:09

    setLocal enableDelayedExpansion
    for /f %%a in (computers.txt) do for /f "tokens=*" %%A in ('findstr /xs "%%a"') do set lastFound=%%A
    echo !lastFound!
    

提交回复
热议问题