Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This may be a stupid question but even after reading the documentation I'm still not sure how to find all lines in a file that contain either ".cpp" or ".h".

Is there a way to do that?

For example (doesn't work):

findstr /i .cpp,.h // , == OR
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Give this a shot, should work for you.

findstr /i "\.cpp \.h" myfile.txt

Wrap both within quotes and separate with a space. Note, you also have to escape the . in both of them.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.