Getting all the lines containing a specific string from a Text File in windows

Posted on

QUESTION :

I have a text file on my windows machine. I have a matching string. Say “check_time”.

I need to get all the lines which have these strings and copy them in a separate file. Only the lines matching this string should be copied. Since, it is a huge log file, searching with CTRL + F is not possible.

ANSWER :

Check out built-in findstr command.

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/findstr

Leave a Reply

Your email address will not be published. Required fields are marked *