I am trying to filter the output of a running program (ping) and write the results to a file.
In the following example the ping program runs until CTRL-C is pressed:
ping www.google.com -t | findstr "Reply" >> file.txt
the result of this is the creation of 'file.txt' however, the contents are empty.
On the other hand, the following code, without piping to findstr works when interrupted with CTRL-C
ping www.google.com -t >> file.txt
What am I missing here?