How to get some specific parts of the result from Dos window?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After running a Dos analysis program, the result composes of randomly several
lines.
I want to catch just some specific parts of the result, not all, in the Dos
window. And then display the specific parts in a message box.
If it is possible, how can I code for this?
For example, I want to get the part information "<<" marked from the
following results.
Thanks a lot.
Havea a nice day.

Eunice.


******the random result from dos analysis program******

Parsing graph file: InputFile.txt

ABC Parameters:
Limit = 0
Iterations = 1
Threshold = 0.00
Nsubs = 3
Beam Length = 4
Connectivity Power = 0.00
Coverage Power = 0.00
Compactness Power = 0.00
Minimum encoding


Predefined substructures file: SubdueDatabase.g

No substructures to replace.
*****************
 
Eunice said:
After running a Dos analysis program, the result composes of randomly several
lines.
I want to catch just some specific parts of the result, not all, in the Dos
window. And then display the specific parts in a message box.
If it is possible, how can I code for this?
For example, I want to get the part information "<<" marked from the
following results.

Well, redirect standard output (and possibly standard error) when you
start the process (see the docs for Process and ProcessStartInfo for
more info on that). Then read the output a line at a time, and when you
see "Input graph Statistics:" start writing the output to the message
box (making sure you do so in a thread-safe way - you almost certainly
don't want the code which reads from the process's output to be
executing on the UI thread).
 
Back
Top