Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I copy the line of a text file (C:\dos\crusoe\src.txt) if the text meghana is in it, and paste the line into another file (C:\dos\crusoe\trgt.txt)?

share|improve this question

migrated from Sep 14 '09 at 14:45

This question came from our site for professional and enthusiast programmers.

I believe on Windows you'd be looking for findstr -

For example:

findstr /x /c:<string> <source-file-name> > <target-file-name>
share|improve this answer
Remember that > erases the target file while >> appends to it. – Sparr Dec 10 '10 at 5:40

You must log in to answer this question.