I have a generated txt file. This file has certain lines that are irrelevant, and need to be excluded. Each line that requires to be removed do not contain the string "2020". I would like to delete these lines, while keeping all other lines.
So txt file like this:
aaa2020
aaa2019
aaa2018
aaa2017
becomes like this:
aaa2020
I have tried
findstr /V "2019" infile.txt > outfile.txt
however that becomes inefficient since I would need to use that command for each incorrect sequence: (2019,2018,2017...)