Fabrice Marchant wrote:
> Thanks a lot William !
>
> > Look at the Unix.open_process* functions <http://caml.inria.fr/pub/
> <http://caml.inria.fr/pub/>
> > docs/manual-ocaml/libref/
> > Unix.html#6_Highlevelprocessandredirectionmanagement>
>
> I've seen the doc and can try these process functions now.
> But that isn't obvious for me. If you know a "screen scrape" example
> somewhere...
All that is really meant here is that you must examine the text being
generated/returned by running commands and parse it enough to be able
to recognize and extract the data of interest to you.
Typically, this could mean using simple pattern-matching to "see"
lines that have useful data, and ignore ones that don't.
The next level of complexity (for information spread across multiple
lines) is to remember what you have seen and are therefore expecting
to see next - essentially simulating a simple finite state machine.
At the extreme end of this approach, you might actually create a
grammar and employ lexical analysis and generator tools.
Robert Roessler
robertr%40rftp.com">robertr
rftp.com
http://www.rftp.com
.