0

I'm console application and want to save the output to a text file. So I do this:

Pi.exe > Pi.txt

Then open the text file and see this:

Calculating Pi to 10,000 decimal places...

Then I se Pi (3.14...)

How can I have the command prompt remove the Calculating Pi to 10,000 decimal places...?

Kredns
  • 496
  • 1
  • 8
  • 15

1 Answers1

2

If you wrote Pi.exe or can change it, the best two options are

  • Change Pi.exe to take a -q option to run 'quietly'
  • Have Pi.exe output 'Calculating Pi' etc to stderr, instead of stdout

Otherwise:

  • Pipe through find /v first:

    Pi.exe | find /v "Calculating Pi" > pi.txt
    

It will capture only lines that don't contain "Calculating Pi".

crb
  • 7,998
  • 1
  • 38
  • 53