Ok, here's the rest of the post:
I'm going to be helping someone with a rather dodgy net connection to get something more reliable then TCP/IP of pidgeon post. I wrote a batch file, which she's running each time the conn goes down.
ECHO "!TEST:!" >> netlog.txt
ECHO "%TIME%" >> netlog.txt
ECHO "%DATE%" >> netlog.txt
ECHO "DNS:" >> netlog.txt
ping {{{{{DNSIP}}}}} >> netlog.txt
ECHO "!EINDE:DNS!" >> netlog.txt
ECHO "GATE:"
ping {{{gatewayIP}}}>> netlog.txt
ECHO "!EINDE:GATE!" >> netlog.txt
ECHO "LCL:" >> netlog.txt
ping [url]www.lcl.nl[/url] >> netlog.txt
ECHO "!EINDE:LCL!" >> netlog.txt
ECHO "!EINDE:TEST!" >> netlog.txt
(Einde=end in Dutch, but I wasn't going to fool around using possibly restrictied words in a langauge I don't know all that well.)
The thing is, I want to parse the lot of it, to produce some statistics on what's going on. Im pinging the DNS, the gateway, and some random site to see what's working and what's not. I want to have certain lines in a var, so I can do comparisons and counting with that var. For example, I'm logging the time and date, and want those so I can get a outages/hour thingy. I also want to get the ping statistics into a var, so I can tear that apart to get all the numbers to add to the stats.
I tried a C++ implementation, but C++ For Dummies is about as understandable as an MS help file.
I can simply count line numbers to get the right data into the right var, but I can't read from a specified line in C, or at least I haven't found the function that lets me.