title: How to write a batch file to find a string in a text file and push it into a new text file
body: <p>i want to write a batch file to find a particular string in a file. If the string is found then i want to redirect the whole line which contains the string to another file. for ex:</p>
  
  <p>suppose a file myfile.txt contains the following text</p>
  
  <pre><code>abcwerthfdh
  qwerewtretywr
  weqreqwrtabcwerwe
  wqerweqabcqwewq
  </code></pre>
  
  <p>when i launch the batch file giving myfile.txt and abc as command line arguments, then the output should be into a file called newfile.txt and it should contain only the lines which contain the text "abc". if i run this code again it should append to newfile.txt and not delete existing contents. in this case it should push the lines 1, 3 and 4 into newfile.txt</p>