Batch file to output last line of findstr
问题 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 /xs "%%a" unhealthy.txt pause The computers.txt file has a list of 300 machines. I want that to output only the last line of each instance it finds. Right now the command displays and outputs all instances of the computer name, not just the tail end. I've tried to use "tail for Windows" but am getting errors as well. Current output: