Use the findstr command:
findstr my-string filename > new-file
findstr /? will give you a message on how to use findstr (including the /V switch if you want to filter the lines, rather than filter them.)
Or, if you are familiar with grep and want it to be on Windows, install Cygwin . :-)
source share