Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

1 Answer 1

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.