Ad

How Does Findstr Extract The Text Line I Want

- 1 answer

I have a txt file.Trying to find out alternate of grep in windows to filter specific data. Below is my input

7892:d=4 hl=3 l=5781 cons: cont [ 2 ]

52:d=4 hl=3 l=5581 cons: cont [ 0 ]

7708:d=4 hl=3 l=4478 cons: cont [ 1 ]

have to get below data

52:d=4 hl=3 l=5581 cons: cont [ 0 ]

Below is my command

findstr ":d=4.*cont [ \0 ]"

This is not working for me. Please suggest the right pattern searching for me .

Ad

Answer

You can try this. My local tests were successful, and findstr seemed to differ on the command line from the regular expression used on the Web page.

findstr ":d=4.*\[.*0"
Ad
source: stackoverflow.com
Ad