As a follow up to my comment, and to show you that my commented commands work exactly as given, (to remove all lines within Scan-FtpOut.txt
which contain the exact string /1001214955/
or which contain the exact case sensitive string /WENP/
, and output those to Ftp_New.txt
).
Here is an example Scan-FtpOut.txt
file:
200 PORT command successful.
150 Opening data connection for /WENP/Faketest (467 bytes).
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec.
200 PORT command successful.
150 Opening data connection for /1001214955/Faketest (467 bytes).
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec.
Here are the contents of Ftp_New.txt
after running @%SystemRoot%\System32\findstr.exe /R /V "\/1001214955\/ \/WENP\/" "Scan-FtpOut.txt" 1>"Ftp_New.txt"
:
200 PORT command successful.
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec.
200 PORT command successful.
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec.
Here are the contents of Ftp_New.txt
after running @%SystemRoot%\System32\findstr.exe /R /V "[/]1001214955[/] [/]WENP[/]" "Scan-FtpOut.txt" 1>"Ftp_New.txt"
:
200 PORT command successful.
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec.
200 PORT command successful.
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec
Here are the contents of Ftp_New.txt
after running @%SystemRoot%\System32\findstr.exe /L /V /C:"/1001214955/" /C:"/WENP/" "Scan-FtpOut.txt" 1>"Ftp_New.txt"
:
200 PORT command successful.
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec.
200 PORT command successful.
226 Transfer complete.
467 bytes transferred in 2.845 seconds. Transfer rate 0.167KB/sec
As you can see the results of each of my initially offered commands show exactly the intended results!