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.

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...?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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".

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.